-
Notifications
You must be signed in to change notification settings - Fork 32
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
#NL assoc array key assignment throwing syntax error #11
Comments
Same bug here. The bash script using optparse works perfectly on Linux, but it throws this error on OSX. |
Well, I investigate and there are two issues actually. First one, on OSX Mavericks, the bash version is 3.7 (released in 2007!). That's very old! Second problem, @nk412 It needs still testing on Linux but I may issue a pull-request if you want. Just let me know. |
+1 osx 10.12 I did this: git cloned this project today
|
@jbenoit2011 can you please submit a PR or explain exactly where this code goes in your fix? |
@nk412 can this be fixed or worked around so that it works on linux and osx? |
For anyone else this seems to simplify it tremendously
|
Cloning the repo and running
$ bash sample_head.sh --help
produces the following output, including a syntax error:Looks like this associative array assignment is throwing the error:
Running the following BASH version:
Any idea how to fix this? My bash foo is pretty weak.
I see the use of
#NL
and#TB
as placeholders for newlines and tabs (respectively), which are replaced on the lines following that assignment. It looks like the use of#
as a special character is the reason for the['#NL']
syntax in the array declaration. Not really sure how that works or how to debug this.The text was updated successfully, but these errors were encountered: