in reply to Check for another program availability
$ perl ./my/script.pl $(which myprogram)
Note: which will not "find" a program in $PATH for a file where -x is not also true. In other words, which requires the "found" file to have executable permissions by the effective user. So, yeah; don't try to reimplement which.my $full_program = `which $program`; chomp $full_program;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Check for another program availability
by hrcerq (Monk) on Apr 11, 2021 at 22:49 UTC | |
by haukex (Archbishop) on Apr 12, 2021 at 05:34 UTC | |
by perlfan (Parson) on Apr 12, 2021 at 10:15 UTC | |
by hrcerq (Monk) on Apr 12, 2021 at 11:55 UTC | |
by Tux (Canon) on Apr 12, 2021 at 13:50 UTC | |
by eyepopslikeamosquito (Archbishop) on Apr 12, 2021 at 23:51 UTC |