Red Hat Enterprise 7.7
by AvivKR from LinuxQuestions.org on (#4TKAE)
Hello all,
I'm new in Linux world.
And I learning to writes scripts..
I've tried to write some script that get a server list, and ports list
and make nmap when done sent it to temp.txt
this is how it's look like:
Code:for i in cat serverlist.txt
do
for k in Portlist.txt
$(nmap $i) > temp.txt
grep $k temp.txt >> serveropenports.txt
doneWhen running this script get this error:
./forloop.sh: line 21: syntax error at line 40: `$(nmap $i)' unexpected
What is the problem?
Thanks for helping! :)


I'm new in Linux world.
And I learning to writes scripts..
I've tried to write some script that get a server list, and ports list
and make nmap when done sent it to temp.txt
this is how it's look like:
Code:for i in cat serverlist.txt
do
for k in Portlist.txt
$(nmap $i) > temp.txt
grep $k temp.txt >> serveropenports.txt
doneWhen running this script get this error:
./forloop.sh: line 21: syntax error at line 40: `$(nmap $i)' unexpected
What is the problem?
Thanks for helping! :)