4 ms·
cicada> echo -e '#!/bin/sh\necho works' > /bin/1 cicada> chmod +x /bin/1 cicada> 1 1 bash> 1 works cicada> touch a b; echo "$(echo "$(echo "$(ls)"
by madmax96 7y ago
cicada> echo -e '#!/bin/sh\necho works' > /bin/1
cicada> chmod +x /bin/1
cicada> 1
1
bash> 1
works
cicada> touch a b; echo "$(echo "$(echo "$(ls)")")"
$(echo $(echo a
b
bash> echo "$(echo "$(echo "$(ls)")")"
a
b
- mitnk 7y ago# you have to use full path to make it work: cicada> /bin/1 A bare `1` is a math arithmetic, as described in README, which with a higher precedence.
- madmax96 7y agoPerhaps you should consider removing the statement "Cicada will only be a "subset" of bash" from the project FAQ.
- mitnk 7y agoFor `touch a b; echo "$(echo "$(echo "$(ls)")")"`, I'll think about it. It looks like a bad command to me (nested $ and nested `"` do not smell good). Probably I would mark this a wont-fix. But if I found I does make sense (useful in some meaningful places) - I'll consider to update cicada to align with Bash. Thanks for reporting.
- aepiepaey 7y agoNested $() is fine, and not uncommon (though 3 levels like here is rarely used). All the nested "" present here are required, as removing any of them would cause a change in behavior (caused by word splitting).