-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Cloning the repo and running $ bash sample_head.sh --help produces the following output, including a syntax error:
$ bash sample_head.sh --help
optparse.bash: line 140: #NL: syntax error: operand expected (error token is "#NL")
sample_head.sh: line 11: source: filename argument required
source: usage: source filename [arguments]
ERROR: Please provide a file
Looks like this associative array assignment is throwing the error:
local -A o=( ['#NL']='\n' ['#TB']='\t' )
Running the following BASH version:
$ bash --version
GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels