mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-22 14:13:04 +00:00
btrfs-progs: tests: fix _is_file_or_command detection
type -p returns an empty string for nonexistent commands, but the -f test on an empty string does not behave the same on all shells. To be safe, use the quoted value. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ffb2878e1e
commit
fb0d53a937
@ -35,7 +35,8 @@ _is_file_or_command()
|
||||
if [ -f "$msg" -o -d "$msg" -o -b "$msg" ]; then
|
||||
return 0
|
||||
fi
|
||||
if [ -f $(type -p "$msg") ]; then
|
||||
msg=$(type -p "$msg")
|
||||
if [ -f "$msg" ]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user