On Fri, Sep 18, 2009 at 6:42 AM, Daniel Bush <[email protected]> wrote:
> Hi,
> Writing a little utility to help me on something but having trouble.
> Why does f stay blank?
>
> d...@lin4:test$ echo "foo|bar" | awk 'BEGIN{RS="|"}{ print $1 }' | while
> read s; do echo $s; f=$s; done; echo "'$f'"
> foo
> bar
> ''
and
> The string being piped is an extended regular expression which I wanted to
> prepend with a file path
You mean, like this?
# echo "foo|bar" | awk 'BEGIN{RS="|"}{ print "filepath/"$1 }'
filepath/foo
filepath/bar
#
If that's not it, could you give an example of the desired output?
Best,
-at
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html