In this tutorial, How to extract substring in Bash Shell on Linux. You can use select substring from the string. The awk command has a few useful functions. It is
Function substr mean Returns a substring.
The syntax
substr(S,P,N)
- P: starting at position
- N: it
is returns N number ofcharacter’s from string S.
For example, I will use a string “HuuPV2123456789” with length is 15 and starting positions is 10.
$ echo "HuuPV2123456789" | awk '{ printf "%s", substr($0, 10, (length($0)-9)) }'
The result as below
456789
man page funtion substr here