Hi how do i grep only a part of the line from a file from all the lines.
file:
asdfgh 543212376 nag
lkjh abhilash 543757858
How do i grep and print only 543212376 and 543757858
Can i grep something like 543* and print only that.
use grep and pipe it thru to either cut or awk
sed may be a better option
sed 's/^.*\(543[0-9]*\).*$/\1/' file
while read line
do
for items in $line
do
case $items in
543* ) echo $items ;;
esac
done
done < "file"