in .rules:
rule "L11"
when
Item L11 received command
then
val String result=executeCommandLine("ping -c 4 google.com | grep \'received\' | awk -F \',\' \'{ print $2}\' | awk \'{ print $1}\'", 15000)
postUpdate(Ping,result)
logInfo("Exec",result)
end
errors:
2016-09-06 13:35:34.941 [INFO ] [org.openhab.model.script.Exec ] - ping: invalid option -- 'F'
Usage: ping [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface]
[-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos]
[-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option]
[-w deadline] [-W timeout] [hop1 ...] destination
Why he misses grep and awk?
I can write any words between ping and -F, and he does not care. The same error.
"@@" Does not help.