Re: Read a file line by line in c shell script - Unix

This is a discussion on Re: Read a file line by line in c shell script - Unix ; sharmila.kuthubdeen@gmail.com wrote: > Hi > i am new to shell scripting & > I wanna read a file line by line in a c shell script and execute some > command for each data in a line and have to ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: Read a file line by line in c shell script

  1. Re: Read a file line by line in c shell script

    sharmila.kuthubdeen@gmail.com wrote:
    > Hi
    > i am new to shell scripting &
    > I wanna read a file line by line in a c shell script and execute some
    > command for each data in a line and have to get the out put for a log
    > file.
    > how I can do this looping process?
    >
    > Help PLS!!!!!
    >
    > Sharm
    >


    Don't write C shell scripts. See

    http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
    http://www.grymoire.com/Unix/CshTop10.txt

    Use sh/bash/ksh/zsh instead.

    Ed.

  2. Re: Read a file line by line in c shell script

    Ed Morton writes:

    > sharmila.kuthubdeen@gmail.com wrote:
    >> Hi
    >> i am new to shell scripting &
    >> I wanna read a file line by line in a c shell script and execute some
    >> command for each data in a line and have to get the out put for a log
    >> file.
    >> how I can do this looping process?
    >>
    >> Help PLS!!!!!
    >>
    >> Sharm
    >>

    >
    > Don't write C shell scripts. See
    >
    > http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
    > http://www.grymoire.com/Unix/CshTop10.txt
    >
    > Use sh/bash/ksh/zsh instead.


    In bash it would be:

    while read line ; do process "$line" ; done < "$file"

    --
    __Pascal Bourguignon__ http://www.informatimago.com/

    In a World without Walls and Fences,
    who needs Windows and Gates?

+ Reply to Thread