PDA

View Full Version : [ubuntu] "200: Command not found" after running a bash one liner



LinuxChick
August 28th, 2011, 08:05 PM
root# for ip in $(200 254); do echo 192.168.13.$ip;done > ips.txt
200: command not found


Not quite sure what the problem is. It should be straight forward.

snip3r8
August 28th, 2011, 08:13 PM
Try separate your commands to root out which one is causing the problem

LinuxChick
August 28th, 2011, 08:19 PM
If I do just "for ip in $(200 254); do echo 192.168.13.$ip"

it seems to think I have more type? It goes to a new line with a > symbol, not sure what's going on.


root@bt:/pentest/enumeration/snmp/onesixtyone# for ip in $(200 254); do echo 192.168.13.$ip
>

LinuxChick
August 28th, 2011, 08:38 PM
Solved


for ip in $(seq 200 254); do echo 192.168.13.$ip;done > ips.txt

is the proper command, i missed the seq

snip3r8
August 28th, 2011, 09:06 PM
That would explain why it didnt like the "200"

Don't forget to mark your thread as solved.

There is also a facility on the forum to display terminal code better by wrapping them in code tags (# in the text editor).


echo "just like this"