OpenAmiga (281/959)

From:Aaron Optimizer Digulla
Date:7 Aug 2000 at 07:31:58
Subject:Re: AMIOPEN: ixemulng library, tools and global variables

On Sun, Aug 06, 2000 at 10:12:38AM +0100, Matthew J Fletcher wrote:

> > - Why doesn't this work:
> >
> > echo vpcc {-Dprefix=}$sys.cwd -T -o ${sys.cwd}/file file.c
> >
> > When I try this, I get "shell: echo: try 'help echo' for documentation".
> > Not very useful :-(
>
> I would suspect (but i have not tested it ! ), that the elate shell`s stupid
> use of {} as ""'' is causing the problem.
>
> This is quite stupid because "" and '' have a different priority, cos in
> unix scripts you can do stuff like echo "grep -r -i `[ami*,sdk*]' | 'sed
> g/.SDK*/.ami*/' | count -w"
>
> Which you could not get to work under elate (at least without a bash port).

Oh, that's simple. Just use: echo {grep -r -i {[ami*,sdk*]} |
{sed {g/.SDK*/.ami*/} | count -w}}.

And if you want to execute this (so that echo prints the words):

echo ${!cmd {grep -r -i {[ami*,sdk*]} | sed {g/.SDK*/.ami*/} | wc -w}}

should do. Note that you must put the commands to run in !cmd inside
{} because !cmd allows to run any number of commands. ${!cmd grep -r ...
would try to run grep, then -r, then ....

Took me about 2h to figure out :-(



==============================================
Sowatec AG, CH-8330 Pf�ffikon (ZH)
Witzbergstr. 7, http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, digulla@sowatec.com
==============================================
Subscribe/Unsubscribe: open-request@amiga.com
Amiga FAQ: http://www.amiga.com/faq.html