-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove all global variables? #42
Comments
On 1/7/16 12:03 AM, Dominic Tarr wrote:
Oh, interesting. I guess POSIX sh doesn't support local? It might be possible to have a $use_local that's either empty or set to local my_var do $use_local my_varJim Nasby, Data Architect, Blue Treble Consulting, Austin TX |
|
Well, not really. local is not a part of POSIX shell command language; dash only added it because it is a nice to have. The no multiple per line thing should be tested with a recent version of dash. |
@Artoria2e5 huh, I guess that'll teach me to verify things before I believe them. I've tested multi-var local on both dash and busybox sh and they both seem fine, so I guess it's probably ok to rely on it. |
The thing about dash and its busybox derivative is that |
Local variables in POSIX shell? Seriously? It is not in standard, so it is not POSIX. (Well, |
Any objection to converting all variables to being local? That would make sourcing the file a lot safer.
At first glance, I think this would mostly amount to passing token to a bunch of functions as an argument, and having them echo it back, though maybe you know of a better way.
I guess the other option is to just declare it as local in parse() and leave it to be set and read by everything else as done today...
The text was updated successfully, but these errors were encountered: