Closed comio closed 6 years ago
All scripts create subshells and compare the resulting output string with construct like this:
if [ $(stat ... "$P") != "btrfs" ]; then ... fi
this construct doesn't protect from empty strings obtaining a syntax error.
To solve, we must use "eval" in order to solve escaping and protect the result:
if [ "$(eval stat ... \"$P\")" != "btrfs" ]; then ... fi
I'd rather avoid using eval, in this case a temporary variable can do the job, like
eval
fst=$(stat ...) if [ "$fst" = "btrfs" ]; ...
Applied, thanks. I've squashed the 2 commits and updated the changelog.
All scripts create subshells and compare the resulting output string with construct like this:
this construct doesn't protect from empty strings obtaining a syntax error.
To solve, we must use "eval" in order to solve escaping and protect the result: