I would like to get part of the string using cut . Here is an example:
$ echo "foobar" | cut -c1-3 | hexdump -C 00000000 66 6f 6f 0a |foo.| 00000004
Note the char added at the end of \n .
In this case, it makes no sense to use cut to remove the last char as follows:
echo "foobar" | cut -c1-3 | rev | cut -c 1- | rev
I still get this extra and unwanted char, and I would like to avoid using an extra command, for example:
shasum file | cut -c1-16 | perl -pe chomp
nowox source share