Skip to content
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

Fix shell parser to handle arrays and looping more like bash #4

Open
GoogleCodeExporter opened this issue Sep 20, 2015 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

To do for-loops, SWAMP currently adheres to a misinterpretation of shell
specifications. 

Therefore, in the following loops,
a=(1 2 3)
for i in $a; do
echo $i
done

b=`seq 3`
for i in $b; do
echo $i
done

... both produce the same output.  In bash/sh, the range is supposed to be
a whitespace-delimited set, instead of an array.  In bash, if you provide
an array to the for-loop, it will treat the first element as the entire
range, meaning that the loop will only iterate multiple times if the first
element is itself a whitespace-delimited range.

SWAMP works this way because of the specification was initially
misinterpreted.  It needs to be fixed.

Original issue reported on code.google.com by daniel2...@gmail.com on 3 May 2008 at 12:33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant