Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
307 B

  1. function hex
  2. switch $argv[1]
  3. case h
  4. # print dec/bin.
  5. printf "%d " (echo "ibase=16;obase=A;$argv[2]" | bc)
  6. printf "%d\n" (echo "ibase=16;obase=2;$argv[2]" | bc)
  7. case d
  8. # print hex/bin.
  9. printf "%s " (echo "obase=16;$argv[2]" | bc)
  10. printf "%d\n" (echo "obase=2;$argv[2]" | bc)
  11. end
  12. end