Find the answer to your Linux question:
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 ...
  1. #1
    Just 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

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    did you try "cat"?
    the sun is new every day (heraclitus)

  3. #3
    Just 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

  4. #4
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.
    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
    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.

    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, drl
    Welcome - 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 )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...