diff options
author | filip <“filip.rabiega@gmail.com”> | 2025-07-10 12:24:33 +0200 |
---|---|---|
committer | filip <“filip.rabiega@gmail.com”> | 2025-07-10 12:24:33 +0200 |
commit | e4ea00cfc9fc7340c62dd920b4754787c4499de6 (patch) | |
tree | 2e4c036888529e99cd67a0ee59d9ac8bb5e09000 /inpath | |
parent | 1feb678fc3d52a7a3c4e31bb153783852fa08a58 (diff) | |
download | chadscripts-master.tar.gz chadscripts-master.tar.bz2 chadscripts-master.zip |
Diffstat (limited to 'inpath')
-rwxr-xr-x | inpath | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,8 +1,8 @@ #!/bin/sh in_path () { - local cmd=$1 path=$2 res=1 - local IFS=":" + cmd=$1 path=$2 res=1 + IFS=":" for dir in $path; do @@ -19,11 +19,11 @@ cmd_in_path () { var=$1 if [ -n "$var" ]; then - if [ $(echo "$var" | cut -c 1) = "/" ]; then - if [ ! -x $var ]; then + if [ "$( echo "$var" | cut -c 1 )" = "/" ]; then + if [ ! -x "$var" ]; then return 1 fi - elif ! in_path $var "$PATH"; then + elif ! in_path "$var" "$PATH"; then return 2 fi fi |