struggling within awk

!#/bin/bash

cat input.sh | awk '
{
cur1=tolower($1)

cur2=tolower($2)

rsh $cur1 report | grep $cur2

# i just want to make the code line to work
} '

the error which i get is ....

./madh1.sh: line 1: !#/bin/bash: No such file or directory
awk: cmd. line:13: rsh $cur1 report | grep tree | grep $cur2
awk: cmd. line:13: ^ syntax error
awk: cmd. line:13: rsh $cur1 report | grep tree | grep $cur2
awk: cmd. line:13: ^ syntax error

i'm new to shell scripting & not comfortable with the awk..can you please help me..

thanks in advance,

regards,
geeko.

1) you got your shebang wrong.
2) to call external commands like rsh, grep etc, you can use system()
3) no need for cat.

hi all,

have been trying to call rsh in the the awk script from 2 days, i didn't get
it finally.. how to use rsh and grep within awk script?

-thanks,
geeko

show your code

[quote=ghostdog74;302139726]
show your code[/QUOTE

the code is above this post :), anyways my code is like this

cat input.txt | awk ' {

rsh $1 quota report | grep tree| grep $2
# in the above line i'm not able to do rsh, grep...
}

the error is

./madh1.sh
awk: cmd. line:5: sh $1 quota report | grep tree | grep $2
awk: cmd. line:5: ^ syntax error
awk: cmd. line:5: sh $1 quota report | grep tree | grep $2
awk: cmd. line:5: ^ syntax error