Which command is used to extract a substring from $string at the $position in Linux?
Answers
Answered by
0
$ echo "Ankitraj707" | cut -c2-6
Here, Ankitraj707 is a string, to extract the substring from it, we use cut command and give the range in the form -cX-Y
$ echo "Ankitraj707" | cut -c2-6
This is a bash scripting and it will give output within the range 2-6, that is nkitr
$ echo "Ankitraj707" | cut -c2-6
nkitr
Similar questions