On Mon, Jun 8, 2009 at 12:50 AM, Rudolf Sykora<[email protected]> wrote: > Hello, > Still wonder, what's the right way to make the following work:
The right way is
s=`{echo $i | sed 's/(.+)_g/\1/'}.
> s = `{sam -d <<EOF <{echo $i} >[2] /dev/null
> 1s/(.+)_g/\1
> p
> EOF
> }
If you must use sam, the right way is
s=`{echo '1s/(.+)_g/
p' | sam -d <{echo $i} >[2]/dev/null }
If you must use here docs, the way that works is
s=`{sam -d <<EOF <{echo $i} >[2]/dev/null}
1s/(.+)_g/\1
p
EOF
Russ
