Hey,

It is pretty straightforward:

--- cut here ---
#!/usr/local/bin/perl

exec("nmap 192.168.1.2");
--- cut here ---

I would just use an sh script for something this simple:

--- cut here ---
#!/bin/sh

nmap 192.168.1.2;
--- cut here ---

If you want to be able to supply optional arguments, we can slightly modify the script to allow for it:

--- cut here ---
#!/bin/sh

nmap $@ 192.168.1.2;
--- cut here ---

So you can do a "./mynmap -A -Ss" and it will run "nmap -A -Ss 192.168.1.2".

Hope that helps.

Sincerely,
Dave Grochowski

linux quest wrote:
Note: forwarded message attached.
--------------------------------- Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit.

------------------------------------------------------------------------

Subject:
Newbie NMap in FreeBSD Question
From:
linux quest <[EMAIL PROTECTED]>
Date:
Sat, 13 Jan 2007 08:53:18 -0800 (PST)
To:
FreeBSD-questions@freebsd.org

To:
FreeBSD-questions@freebsd.org


   Lets say, I wanted to create a Perl script to execute a very simple
   nmap command as listed below, may I know how do I do it?
   unix# nmap 192.168.1.2
   I know we need to save it in .pl extension. May I know what else I
   need to do. I hope someone can share with me the simple coding.
   Thanks. [01.gif]
   Regards,
   Linux Quest
     _________________________________________________________________

   8:00? 8:25? 8:40? [1]Find a flick in no time
   with the[2]Yahoo! Search movie showtime shortcut.

References

   1. http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news
   2. http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news

------------------------------------------------------------------------

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to