bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how do I do $*:q in bash shell


From: Chris F.A. Johnson
Subject: Re: how do I do $*:q in bash shell
Date: Thu, 17 Jun 2004 20:13:34 -0400 (EDT)

On Thu, 17 Jun 2004, botao wrote:

Hi,

I have a tcsh script which has

   exec $tool $*:q

I am trying to convert this into bash shell as

   exec $tool $@

It does not work in some cases, ie

   <script>   "first arguemnt" "second argument"

in csh, $tool gets 2 argument; in bash $tool get 4 argument.

Can somebody help me on this?

     Use "$@".

man bash:

   Special Parameters
       The  shell  treats  several parameters specially.  These parameters may
       only be referenced; assignment to them is not allowed.
     ........
       @      Expands  to  the positional parameters, starting from one.  When
              the  expansion  occurs  within  double  quotes,  each  parameter
              expands to a separate word.  That is, "$@" is equivalent to "$1"
              "$2" ...

--
        Chris F.A. Johnson                      http://cfaj.freeshell.org
        =================================================================
                Everything in moderation -- including moderation




reply via email to

[Prev in Thread] Current Thread [Next in Thread]