user2601570 user2601570 - 7 months ago 43
Bash Question

ubuntu linux shell scripting with command line grep and split delimiter

i have this line :

S=`cut -d: -f4 | grep $name info.txt`;

then i display by

echo "$S";

It display nothing.

grep $name info.txt
;` gives me output :

Francis:8:98765432:commission // this is a line from my textfile separated by :

i am trying to display


This will also work

    echo 'Francis:8:98765432:commission' | cut -d: -f4