Re: Can $1 be set in a script?
- From: larryalk <nobody@xxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 02:55:51 GMT
On Thu, 30 Mar 2006 15:46:02 -0500, "Chris F.A. Johnson"
On 2006-03-30, larryalk wrote:
Can $1 be set to something else in a script?set -- teststring "$@" ## "$@" adds existing positional parameters
Chris I apologize because I didn't see how your 'set' line worked.
I thought the 'set ' would just give me a single string instead of
parsing the command line parameters into $1 $2 etc.
When I tested it worked perfectly:
I made a little executable and found that
set "$@"
echo $1 $2
gave me:
testprog one two three
testprog: one two
That's the answer I needed.
Sorry I didn't see it the first time.
or
$1=$($2)
Is that what you want? to put the output from a command in $2 into
$1?
set -- "$($2)"
What does the double dash do?
Larry
--
My real sig is much better.
.
- Follow-Ups:
- Re: Can $1 be set in a script?
- From: Bill Marcum
- Re: Can $1 be set in a script?
- References:
- Can $1 be set in a script?
- From: larryalk
- Re: Can $1 be set in a script?
- From: Chris F.A. Johnson
- Can $1 be set in a script?
- Prev by Date: Re: Can $1 be set in a script?
- Next by Date: Re: Can $1 be set in a script?
- Previous by thread: Re: Can $1 be set in a script?
- Next by thread: Re: Can $1 be set in a script?
- Index(es):
Relevant Pages
|