- To: slug <slug@xxxxxxxxxxx>
- Subject: Re: [SLUG] shell scripting help
- From: Aleksey Tsalolikhin <atsaloli.tech@xxxxxxxxx>
- Date: Fri, 18 Sep 2009 12:54:55 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=DfQNPWe7rUGvlarrB2F3VW9uSfVlY8+Q49V9hiKjH8s=; b=L0lccz+G+fHKZorqkDgQOJBrwdaMSUAyNGm1H/KVyPrmx98d/jzvBMy1ZQozstGg0M s98IU8BmdD4xlf7wvVKhw/PIyVsQuhz2dRSwBitliEZCu68HY3tlutNYG1ZsbhXNoziT rKzeFX45yyW4y4g0T5cLObcqBQMnSOzjDQQJA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=SLHrFdCSsEWemkOTz/5dev7yHLdCNyic4JRLWnnLLrBuW6WZvay+55dPBaEjrRbYnU Ok8Q9NDIPcxE8nhIReitSRiYSwTrmPSY35UHMGn9GmWwVWsmZafQcirTVJ1/O6mQLXAp E6ZGCjOVnhVzSsEC/jbUpDnksq/vJz3+x736A=
On Fri, Sep 18, 2009 at 6:42 AM, Daniel Bush <dlb.id.au@xxxxxxxxx> wrote:
> Hi,
> Writing a little utility to help me on something but having trouble.
> Why does f stay blank?
>
> danb@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