Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: please advice
- X-seq: zsh-users 3237
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: please advice
- Date: Fri, 30 Jun 2000 13:39:48 +0200 (MET DST)
- In-reply-to: Mircea Damian's message of Fri, 30 Jun 2000 14:27:52 +0300
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
Mircea Damian wrote:
> Hello,
>
> I'm trying to use and old bash script and port it to zsh.
> It now basically does:
>
> #!/bin/zsh
>
>
> if [ $# -gt 0 ]; then
> echo "Number of arguments: $#"
> exit
> fi
>
> PRGARG="-bla1 -bla2 -bla3"
>
> $0 $PRGARG
>
>
> In zsh the number of arguments will be 1. How can I expand(?) it to three
> as bash does?
One of the places where zsh differs from other shells, doing the right
thing.
One possibility is to set the shwordsplit option, if you really want
it everywhere. Our you can force word splitting for that one parameter
expansion by using: `$=PRGARG'.
The best way would be to use an array, though.
PRGARG=(-bla1 -bla2 -bla3)
$0 $PRGARG
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author