#1
  1. No Profile Picture
    Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    13
    Rep Power
    0

    C-shell script problem?


    here is my code.and i cannt find it out what's goin on?

    #!/bin/csh
    set length="wc -l"
    set header="grep -i origin" $file
    @ans=$length - $header
    tail -$ans $file

    basically, what i am trying to do is i want to print it out all the stuff after the word "ORIGIN" in a txtfile.

    anyone has any suggestions to fix it?


    thanx very much
    plz either post it here or emal me:kissmegoodbey@yahoo.com


    thanx very much
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Location
    USA
    Posts
    334
    Rep Power
    12
    If you really want to print everything in the text file after "ORIGIN'
    sed will probably work for you

    sed -n -e '1,/ORIGIN/!{p;}' file

    or

    sed -n -e '/ORIGIN/,${p;}' file

    if you want the line containing ORIGIN also.

    - Finnbarr

IMN logo majestic logo threadwatch logo seochat tools logo