Hi ,
could anyone help me out with this problem.
sample.txt has this content :
u001- this is used for project1 ||
u002- this is used for p2|| not to be printed
u003- this is used
for project3 ||
u004- this is
used for p4 ||
u005- this is used for project5 ||
u006- this is used for p6 ||
I need a shell script , for which the input will be 'u001' or 'u00X'...
and i need to print the words between - and || of that particular string.
I am able to print the word if all the words are in the same line..
a=`grep -iw $1 sample.txt | awk -F"-" '{print $2}' | awk -F"||" '{print $1}'`
echo $a
this holds good for u001,u002,u005,u006..
can anyone help me with the code ...if my input is u003,u004