How to do whilespace-insensitive string compare in fish
Jump to navigation Jump to search
test "a b " = "a b"
exits with 1; this comes up with `fish_postexec`:
if test "$argv" = "$EDITOR ~/.profile" -> test vim ~/.profile = vim ~/.profile
which itself happens because tab completion adds a space at the end.
test (echo "$argv" | string trim) = "$EDITOR ~/.profile"