Results 1 to 4 of 4
Hi all,
I have to port a bash script to sh. The bash use the local key word
in function to restrict the visibility of variables.
How can I do ...
- 10-04-2007 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 2
Porting bash to sh: how to replace local?
Hi all,
I have to port a bash script to sh. The bash use the local key word
in function to restrict the visibility of variables.
How can I do that in sh?
Thanks a lot for any hint,
Xavier.
- 10-04-2007 #2
AFAIK, local is unnecessary. Simply saying
Will make the variable only accessable in the scope of the current function and shell.Code:VAR=value
- 10-04-2007 #3
Well I took a look at the man page after I said that, and there is a case where it would be necessary, but to judge that you'd need to give a bit more detail as to how the script is structured and what the variable is for.
- 10-08-2007 #4Just Joined!
- Join Date
- Oct 2007
- Posts
- 2
Thank you for answer.
It's fixed by just removing it.
Xavier.


Reply With Quote