Re:Cicada – Unix shell written in Rust
by city41 on Saturday July 01, 2017 @02:45AM
(#14675757)
Being able to do arithmetic right in the shell is handy.
[ Parent
| on HN ]
Re:Cicada – Unix shell written in Rust
by icebraining on Saturday July 01, 2017 @03:20AM
(#14675850)
$ echo $((1 + 2 * 3 - 4))
3With zsh, you can even save a few keystrokes.
function c() {
echo $(($@))
}
alias c='noglob c'zsh can handle floating point arithmetic too, while bash can't.
They way they chose to do it though seems to create some ambiguity. Like, what does this do? I can think of 3 distinctly different things it could do.
$ echo test 1 + 2>err
Or what if there are files with these names?
$ cp /bin/grep 42
$ 42 + 1