why set command change $1's value?
Code:
cat a.sh Code:
#!/bin/bash Code:
bash a.sh 1 2 3 4 5 1 2 3 4 5 a=b why command Code:
set a=b |
Because that is exactly what the set command is supposed to do. What were you expecting it to do?
See man bash, look under Shell Builtins, set for full details, but here is the applicable part: Code:
set [+abefhkmnptuvxBCEHPT] [+o option-name] [arg ...] |
Hi.
In the off-chance you have been coding/inherited csh, one does use: Code:
set a=b Code:
a=b Best wishes ... cheers, makyo |
Thanks astrogeek, and makyo, your replies are very useful for me, happy to know you guys:)
|
look into 'shift' to move the value over to the next one.
The shift built-in Handling positional parameters excerpt Code:
Shifting |
All times are GMT -5. The time now is 09:42 AM. |