2 ms·
> 3. The syntax is wrong. For example in bash, there are more ways to write a loop that I can to mention. Often I find myself wondering if I need no brackets, [
by SAI_Peregrinus 4y ago
> 3. The syntax is wrong. For example in bash, there are more ways to write a loop that I can to mention. Often I find myself wondering if I need no brackets, [], [[]], (), (()) - it really shouldn't be this hard or varied.
If you want even weirder syntax, just never use square brackets. Write out `test` commands manually. E.g. instead of `if [ ${string1} = ${string2} ]; then` write `if test ${string1} = ${string2}; then`. `[` is just an alias for `test`. Combining comparisons can get a bit harder to keep track of though, since there's no `]` and `test` allows logical operations with `-a` and similar. Better to call `test` multiple times and use the shell-native `&&` and similar IMO.