2

I have the following file conf.txt:

perl /home/site/gen.pl  "GG - W C1 Test - sai1" "15072" && ssh 13.4.93.103 
perl /home/site/gen.pl  "GG - W C1 Test - sai2" "15072" && ssh     13.4.93.104 
perl /home/site/gen.pl  "GG - W C1 Test - sai3" "15072" && ssh 13.4.93.105 

how to print the third field - between the "...." ,

for example

GG - W C1 Test - sai1
GG - W C1 Test - sai2
GG - W C1 Test - sai3

2 Answers 2

3

Try using awk:

awk -F'"' '{ print $2 }' conf.txt
3
cut -d\" -f2 <infile >outfile

That's all you need.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.