How do I extract 5th to 10th characters of string as given below stored in a shell variable.
"ab cd ef gh ij kl"
How is cut to be used on this?
Thanks for any help.
How do I extract 5th to 10th characters of string as given below stored in a shell variable.
"ab cd ef gh ij kl"
How is cut to be used on this?
Thanks for any help.
VAR1="ab cd ef gh ij kl"
VAR2=`echo $VAR1 | cut -c5-10`
echo $VAR1
echo $VAR2
Cheers,
Keith