On Mon, Apr 02, 2012 at 04:28:54PM +0200, Fidu wrote:
> test "rrr" > $x  redirects to file sss, instead of comparing.
> Any hint?
test rrr \> "$x"

or

test rrr ">" "$x"

However, it should be noted that ">" as a string comparison operator in
the test command is an extension, and not portable.  As such, it might
be better to use [[ so that you can *plainly see* that the code is using
bashisms, and is not sh-compatible.

[[ rrr > "$x" ]]

This gives you the benefit of not needing to quote the > operator, as well
as the visual clue about non-portability.

Reply via email to