“which in ruby”: Checking if program exists in $PATH from ruby

后端 未结 16 1088
萌比男神i
萌比男神i 2020-12-07 12:15

my scripts rely heavily on external programs and scripts. I need to be sure that a program I need to call exists. Manually, I\'d check this using \'which\' in the commandlin

16条回答
  •  萌比男神i
    2020-12-07 12:48

    I'd like to add that which takes the flag -s for silent mode, which only sets the success flag, removing the need for redirecting the output.

提交回复
热议问题