From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 8 Jun 2009 02:35:13 -0700 Message-ID: Subject: Re: [9fans] simple question: multiple rename From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: 06368736-ead5-11e9-9d60-3106f5b1d025 On Mon, Jun 8, 2009 at 12:50 AM, Rudolf Sykora wro= te: > Hello, > Still wonder, what's the right way to make the following work: The right way is s=3D`{echo $i | sed 's/(.+)_g/\1/'}. > s =3D `{sam -d <[2] /dev/null > =C2=A0 =C2=A0 =C2=A0 =C2=A01s/(.+)_g/\1 > =C2=A0 =C2=A0 =C2=A0 =C2=A0p > =C2=A0 =C2=A0 =C2=A0 =C2=A0EOF > =C2=A0 =C2=A0 =C2=A0 } If you must use sam, the right way is s=3D`{echo '1s/(.+)_g/ p' | sam -d <{echo $i} >[2]/dev/null } If you must use here docs, the way that works is s=3D`{sam -d <[2]/dev/null} 1s/(.+)_g/\1 p EOF Russ