> Yuck, yuck, yuck! It looks like everyone was pointing out ways to
> use sed to accomplish this. Now, sed may give you extra
> power, but when
> writing shell scripts, I prefer to avoid using external commands where
> possible. To that extent, consider:
>
> $ foo="1234M /home/USER"
> $ echo ${foo##*/}
> USER
> $
>
Here's a simple question for the group. How do I loop through each line of output in
the bourne shell when the line also contains spaces? If I use the 'for' keyword, it
loops through each word rather than each line. E.g:
% /usr/bin/echo "line 1\nline 2"
line 1
line 2
% for LINE in `/usr/bin/echo "line 1\nline 2"`
> do
> echo $LINE
> done
line
1
line
2
Does anyone know how to loop through each line instead, so that the output would be
line 1
line 2
? Thanks.
Warren
*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************