bash programming
Hi ... :)
I want to create ascript that can read and modify a environmental variable... Cn u help me a little? For example a=2 sh myscript a has value 2 changing a a has value 3 After the script has stopeed executing i want to read the new value of a .... Any good suggestion? Thx a lot |
You cannot do this in the way you have described. A script can only change variables in its own environment, which are then inherited by children, but leave parents unaffected. The closest you can get is this:
Code:
#!/bin/bash Code:
$ source SCRIPT_ABOVE.sh Code:
$ . SCRIPT_ABOVE.sh |
Quote:
Cheers, Tink |
All times are GMT -5. The time now is 01:28 PM. |