Re: Can $1 be set in a script?



On 2006-03-30, larryalk wrote:
Can $1 be set to something else in a script?

[I don't think this is the right groups for this question]

For exampe:
$1=teststring

set -- teststring "$@" ## "$@" adds existing positional parameters

or
$1=$($2)

Is that what you want? to put the output from a command in $2 into
$1?

set -- "$($2)"

I have scripts with $1 in them that I don't want to change.

--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
.