Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem of a newbie

Status
Not open for further replies.

wally1

Technical User
Mar 24, 2003
27
IT
I have this statement in a unix script
condizio='>/dev/null; [ $? -eq 0 ] && echo 0 >'$file7
echo $condizio
awk '{n=split($1,a,"/");split(a[n],b,"."); printf "grep \" b[1] \" '$trasporti_locale' %s " condizio}' condizio=$condizio $file3 >$file4

when i run my script in ksh i have this result:
>/dev/null; [ $? -eq 0 ] && echo 0 <- this is $condizio >/tmp/lista_risultato_finale_trasp_P01_Mar_21
awk: can't open [
i can't understand why awk con't open [ ??????
Anyone can help me to insert the value of condizio string at the end of all row of $file3 to create a new file ( $file4)

Thanks in advance !!!!!!!!!!!!!!!!!!!!!!
 
Wally:

I'm having trouble decyphering what you want, but to anser this question:

>Anyone can help me to insert the value of condizio string >at the end of all row of $file3 to create a new file ( >$file4)

this is a way:

file3=&quot;file3&quot;
condizio=&quot;55&quot;
# awk script is all one line
awk ' { printf(&quot;%s %s\n&quot;, $0, condizio) } ' condizio=&quot;$condizio&quot; $file3 > file4

Regards,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top