Ok, I got it. And this would do the opposite:
(! ping 127.0.0.1 -c 1 | grep "64 bytes") || echo "Host is up.";
(! ping 127.0.0.1 -c 1 | grep "64 bytes") || echo "Host is up.";
umm.. no, the NOT (!) should be outside the parenthesis, although I'm no bash expert to know what that eventually should mean.Ok, I got it. And this would do the opposite:
(! ping 127.0.0.1 -c 1 | grep "64 bytes") || echo "Host is up.";
umm.. no, the NOT (!) should be outside the parenthesis, although I'm no bash expert to know what that eventually should mean.Ok, I got it. And this would do the opposite:
(! ping 127.0.0.1 -c 1 | grep "64 bytes") || echo "Host is up.";
[root@summer root]# (! ping 127.0.0.1 -c 1 | grep "64 bytes") || echo "Host is up."
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.196 ms
Host is up.
[root@summer root]# !(ping 127.0.0.1 -c 1 | grep "64 bytes") || echo "Host is up."
-bash: !: event not found