Re: nc missing option -z

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

 



On Wed, Feb 13, 2013 at 10:18:44AM +0100, Suvayu Ali wrote:
> On Wed, Feb 13, 2013 at 08:45:39AM +0000, James Hogarth wrote:
> >
> > The other alternative to tcping is nmap ...
> > 
> > nmap -Pn -p993 imap.gmail.com
> 
> I guess switching to nmap might resolve the second issue.
> 

This presents a different annoyance.  Now I have to parse the output to
determine if the port scan passed or failed since nmap returns 0
regardless of the results (which is understandable IMO).  Now something
simple like

  $ nc -z imap.gmail.com 993 &> /dev/null && { ... }

becomes

  $ 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.  :-/

-- 
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