script question



From a script, I want to print all the lines of a file up to a line
containing the word "END".
Something like:

# grep -avw -m 1 "END" -f bla.txt

or

# cat bla.txt | while read line; do
echo $line
if [ "$line" == "END" ]; then break; fi
done


....except a script that actually works. The second one above does not
work because
the "read line" corrupts the lines by removing whitespace. I don't
know why the
first one doesn't work.

-Mike

.



Relevant Pages

  • Re: Grep and mv
    ... different from echo "$i". ... I repeat my suggestion that you run the script ... Change the "cat" in my script to "cat -v" before you run it ...
    (comp.unix.shell)
  • Re: [UPDATED]sick and tired of freebsd resolving problems
    ... Just copy and paste your input and the machine responce. ... echo "done" ... Run the following script for at least four seconds but not ... % cat checkping.sh ...
    (freebsd-questions)
  • Re: javascript doesnt work on pages loaded by ajax
    ... But the script works when page1.html is ... (which browser) ... $ cat page1.html ...
    (comp.lang.javascript)
  • Re: Passing parameters from a flat file.
    ... > I am writing a series of strings to a file for later use. ... > contents as parameters to another script (sounds overly complicated I ... > has a space in it, and I cat the contents of the file as the ... > echo $1 ...
    (comp.unix.shell)
  • Re: Script w/ backquotes not working.
    ... Well I guess I will post my whole script. ... I then run that through the for command to echo that to the email file. ... Then I changed it to a file and just cat the file. ... # Reports all the clients file list in an Email ...
    (comp.unix.shell)