How does testing if a string is 'greater' than another work in Bash?

Viewed 35009

In Bash I can write the following test

[[ "f" > "a" ]]

which results in returning 0, i.e. true. How does bash actually perform this string comparison? From my understanding > does an integer comparison. Does it try to compare the ASCII value of the operands?

3 Answers
Related