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

Newline replacement with semicolon not always safe #38

Open
skeggse opened this issue Nov 14, 2022 · 0 comments
Open

Newline replacement with semicolon not always safe #38

skeggse opened this issue Nov 14, 2022 · 0 comments

Comments

@skeggse
Copy link

skeggse commented Nov 14, 2022

Some scripts can't be directly converted by string replacement. A good example is a for loop:

for value in 1 2 3 4; do
  echo "$value"
done

This gets converted to for value in 1 2 3 4; do; echo "$value"; done, causing:

ash: syntax error: unexpected ";"

The extra ; after the do is the source of this particular error.

It seems that simply passing in the script unchanged works fine; what's the intent behind modifying the input run value instead of passing it in with the newlines intact?

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

No branches or pull requests

1 participant