Well, there have been solutions here with sed
, awk
, cut
and using bash
syntax. I just want to throw in another POSIX conform variant:
$ echo "pid: 1234" | tail -c +6
1234
-c
tells tail at which byte offset to start, counting from the end of the input data, yet if the the number starts with a +
sign, it is from the beginning of the input data to the end.