well, they are. it's like reading keyboard macros. btw i think you meant to \ your *s
Re:Unix History and the `DC` Calculator
by bawolff on Monday September 02, 2024 @12:33PM
(#41426786)
Oh, you are correct. Hn ate the formatting. The example is stolen from wikipedia. Lets try that again:
dc -e '_640320[0ksslk3^16lkd12+sk*-lm*lhd1+sh3^/smlxlj*sxll545140134+dsllm*lxlnk/ls+dls!=P]sP3^sj7sn[6sk1ddshsxsm13591409dsllPx10005v426880*ls/K3-k1/pcln14+snlMx]dsMx'
Cool, will save this. People should run this if they do not know what it does.
For those who are on NixOS and can’t find `dc`, it’s present in BusyBox.
nix run nixpkgs#busybox -- dc -e '_640320[0ksslk3^16lkd12+sk*-lm*lhd1+sh3^/smlxlj*sxll545140134+dsllm*lxlnk/ls+dls!=P]sP3^sj7sn[6sk1ddshsxsm13591409dsllPx10005v426880*ls/K3-k1/pcln14+snlMx]dsMx'> For those who are on NixOS and can’t find `dc`
$ nix-locate -r 'bin/dc$' | grep -o '^\w.*\.out' | xargs basename -s .out
plan9port
gavin-bc
busybox
bc
_9base
:)Haha, thanks! I had completely forgotten about `nix2` commands. I’ll try to remember this one!
nix-locate is actually a third-party command, shipped with nix-index: https://github.com/nix-community/nix-index
make sure to check out the pregenerated databases, they're very convenient
E.g. dc -e '_640320[0ksslk3^16lkd12+sk-lmlhd1+sh3^/smlxljsxll545140134+dsllmlxlnk/ls+dls!=P]sP3^sj7sn[6sk1ddshsxsm13591409dsllPx10005v426880*ls/K3-k1/pcln14+snlMx]dsMx'