For reference, the Bash equivalents are discussed here: Check if a program exists from a Bash script
I've been doing something like
if `which commandname` =~ /commandname/
# do stuff
end
but I'm wondering if there is something a little cleaner.
For reference, the Bash equivalents are discussed here: Check if a program exists from a Bash script
I've been doing something like
if `which commandname` =~ /commandname/
# do stuff
end
but I'm wondering if there is something a little cleaner.
system("ls")
#=> true
system("ls wrong params")
#=> false
system("lss")
#=> nil
if system("your cmd")
puts "yey!"
else
puts "oups"
end