bash_minifier icon indicating copy to clipboard operation
bash_minifier copied to clipboard

Minified redirection operators cause errors

Open systemmonkey42 opened this issue 8 years ago • 1 comments

Hi, I'm not sure if you are maintaining this script, but I've been finding it pretty useful.

I've encountered a few issues, but only one which I could fix without changing your code.

The '<()' operator when used with input redirectory 'read < <(echo hello)' is "minifined" to 'read<<(echo hello)' Without the space between the two '<' operators, they become '<<(' which is an error.

This is bash specific.

Other problems like 'if [[ $\n$a != $test ]];' resulted in 'if [[ $'\n'$a!= $test ]];' . The loss of the space before the '!=' broke the script, however that was easy enough to work around with quoting.

Cheers

systemmonkey42 avatar Jun 01 '17 06:06 systemmonkey42

@systemmonkey42 The first issue has been fixed. I can't reproduce the 2nd one -- can you provide a small file that is not minified correctly please?

Thank you for reporting issues!

UPD Just noticed that '[[' bash builtin is not handled correctly -- newlines inside are replaced with semicolons. So I'm working on a fix.

precious avatar Jun 01 '17 15:06 precious