bug-bash
[Top][All Lists]
Advanced

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

Re: how to save "$@", shift and reset $@ ?


From: Paul Jarc
Subject: Re: how to save "$@", shift and reset $@ ?
Date: Thu, 29 May 2003 17:11:53 -0400
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

gk <gk@proliberty.com> wrote:
> Thanks for the great ideas.
> This does the trick for me:
>
> #!/usr/local/bin/bash
>
> echo num params=$#
> saved=("$@")
> echo 'set -- $saved'
> set -- $saved

I think that should be:
set -- "${saved[@]}"
Otherwise, you'll only get the first argument, and it'll be split.


paul




reply via email to

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