Operating System - HP-UX
1837785 Members
3985 Online
110119 Solutions
New Discussion

Re: File content Checking

 
SOLVED
Go to solution
Pando
Regular Advisor

File content Checking

I have a file which contain the line
...
...
"XXXXX"
...
...
I need to get the XXXXX part to be passed to a variable. How can i get it in a single command?

Maximum points for correct reply!

1 REPLY 1
Patrick Wallek
Honored Contributor
Solution

Re: File content Checking

This should work:

VAR=$(grep "" file | awk -F " '{print $2}')

You might have to escape the " in the '-F' like:

VAR=$(grep "" file | awk -F \" '{print $2}')