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