Re: nc missing option -z

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ed and James,

On Wed, Feb 13, 2013 at 09:45:05AM +0000, James Hogarth wrote:
> >   $ nmap -Pn -p993 imap.gmail.com |& grep -q 'Host is up' && { ... }
> >
> > And of course someday the printed text will change and I'll have to edit
> > my scripts again!  Oh well.  :-/
> >
> 
> 
> Host is up wouldn't be right - you need to parse to see if the port is
> listed as open or closed...
> 
> Something like:
> 
> nmap  -Pn -p993  imap.gmail.com | awk '$1 ~ /993/ {print $2}'  | grep open

I read the man page, but wasn't thinking when I wrote the grep line :-p.
You are right, looking for the port/service is the correct way.

I think the older package was nc, but I'm not very much in for of
checking versions.  That would unnecessarily complicate my simple
scripts.  I cannot use tcping as Ed suggested because it is not
installed in these other systems, hence parsing nmap output seems my
only viable option.

Thanks a lot for all the help.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux