File: display_bytes.fish

package info (click to toggle)
fish 3.0.2-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,448 kB
  • sloc: ansic: 75,559; cpp: 43,314; sh: 9,096; javascript: 7,710; python: 2,538; makefile: 1,461; objc: 709; perl: 367; xml: 18
file content (11 lines) | stat: -rw-r--r-- 600 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
# This is needed because GNU and BSD implementations of `od` differ in the whitespace they emit.
# In the past we used the `xxd` command which doesn't suffer from such idiosyncrasies but it isn't
# available on some systems unless you install the Vim editor. Whereas `od` is pretty much
# universally available. See issue #3797.
#
# We use the lowest common denominator format, `-b`, because it should work in all implementations.
# I wish we could use the `-t` flag but it isn't available in every OS we're likely to run on.
#
function display_bytes
    od -b | sed -e 's/  */ /g' -e 's/  *$//'
end