2nd word
echo '* CRISTOBAL AL042014 08/05/14 12 UTC *' | awk '{print $2}'
will provide you CRISTOBAL
echo 'testing only' | awk '{print $2}'
will give you only
You may need to change this if the line structure changes.
2nd word from lines in a text file
If your text file contains the following two sentences
this is a test * CRISTOBAL AL042014 08/05/14 12 UTC *
running awk '{print $2}' filename.txt will return
is CRISTOBAL
2nd character
echo 'testing only' | cut -c 2
This will give you e , which is the 2nd character, and you may need to change it to suit your needs.
source share