Results 1 to 4 of 4
is there a command or set of command to read file in c shell?
I have this command but it read only one line and ignore remaining lines
Code:
cp ...
- 08-19-2007 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
How can I read from text file in c shell ?
is there a command or set of command to read file in c shell?
I have this command but it read only one line and ignore remaining lines
Code:cp test.txt temp.txt head -n 1cp test.txt temp.txt
- 08-19-2007 #2Linux User
- Join Date
- Jan 2007
- Location
- cleveland
- Posts
- 452
did you try "cat"?
the sun is new every day (heraclitus)
- 08-19-2007 #3Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
yes but I wont to read line by line
not all of lines one time
I wont to do a command to each line
- 08-19-2007 #4Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Hi.
This is another of the reasons most people favor the Bourne shell family for scripting. The little piece of information about $< is buried deeply in man csh, so could be easily be missed.1b. Reading Files
In the csh, all you've got is $<, which reads a line from your tty. What
if you've redirected stdin? Tough noogies, you still get your tty, which
you really can't redirect.
More at: Csh Programming Considered Harmful
There are some basic examples of tasks for both families at CHAPTER 9 Shell Programming.
The first 3 columns of Rosetta Stone for Scripting Languages compare the sh, ksh and csh language elements (the others cover more complex scripting languages). Many of the features noted for sh and ksh can be used in bash. See also the links at the bottom of the Rosetta page ... cheers, drlWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )


Reply With Quote