bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: HERE document mystery


From: Com MN PG P E B Consultant 3
Subject: RE: HERE document mystery
Date: Fri, 16 Dec 2005 11:50:56 +0100

> "Com MN PG P E B Consultant 3" 
> <address@hidden> wrote:
> > echo THIS DOES NOT WORK
> > foo=$(cat exp_test <<BAD | tr -d V= | grep '[0-9]*')
> > V=1234
> > abcd
> > BAD
> 
> 0. Since you passed a file name to cat, it will ignore stdin.
> 1. Since the here-document belongs to the command in $(), the
>    here-document must also be entirely inside $().  Move the closing )
>    after "BAD".
> 2. [0-9]* matches every line, since * matches 0 or more occurrences.

Thank you VERY much! I introduced stupidity #0 and #2, when I tried
to turn my real application into a "simple example". But #1 was the
explanation I was really looking for! I did not even know that a $(...)
is allowed to span several lines.

Ronald
-- 
Ronald Fischer (phone +49-89-63676431)
mailto:address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]