How to check the return value (true / false) of a bash command in an if expression in Ruby. I want something like this to work,
if ("/usr/bin/fs wscell > /dev/null 2>&1")
has_afs = "true"
else
has_afs = "false"
end
He complains about the following error value, it always returns true.
(irb):5: warning: string literal in condition
What is the correct syntax?
UPDATE:
/usr/bin/fs wscell
Searches for an afsestablished and running condition. It will call such a line,
This workstation belongs to cell <afs_server_name>
If it afsdoes not work, the team exits with status 1
source
share