zsh-users
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-users@sunsite.auc.dk
Subject: Re: please advice
Date: Fri, 30 Jun 2000 13:39:48 +0200 (MET DST)	[thread overview]
Message-ID: <200006301139.NAA00844@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Mircea Damian's message of Fri, 30 Jun 2000 14:27:52 +0300


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@informatik.hu-berlin.de


             reply	other threads:[~2000-06-30 11:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-30 11:39 Sven Wischnowsky [this message]
2000-06-30 12:03 ` Mircea Damian
2000-06-30 12:16   ` Andrej Borsenkow
2000-06-30 12:21     ` Mircea Damian
  -- strict thread matches above, loose matches on Subject: below --
2000-06-30 12:14 Sven Wischnowsky
2000-06-30 12:17 ` Mircea Damian
2000-06-30 11:27 Mircea Damian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200006301139.NAA00844@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).