Please help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Please help
# 1  
Old 01-14-2008
Please help

Hi,

I ahve a script as below.
name="file1"
.........
............
awk '/$name/ {print $1$2}' a.sh > b.sh

What i need is to search for the content of the variable 'name' and print
# 2  
Old 01-14-2008
Bug Please help very urgent

Hi,

I have a script as below.
name="file1"
.........
............
awk '/$name/ {print $1$2}' a.sh > b.sh

What i need is to search for the content of the variable 'name' and write it to b.sh.

But the above command does't work.
Could u please help me in gettig the value of the variable name to use it in awk (as above)
Thanks in advance !!
# 3  
Old 01-14-2008
Code:
awk '/'"${name}"'/ {print $1$2}' a.sh > b.sh

# 4  
Old 01-14-2008
Quote:
Originally Posted by Klashxx
Code:
awk '/'"${name}"'/ {print $1$2}' a.sh > b.sh

Thank u so much !!!
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question