diff --git a/SC3012.md b/SC3012.md index 42f388c..07af52e 100644 --- a/SC3012.md +++ b/SC3012.md @@ -18,11 +18,11 @@ First, make sure you wanted a lexicographical comparison (aka dictionary order), Then to compare as string, you can use `expr` and make sure that the strings are not interpreted numerically by adding some non-numerical data to them. Here, an apostrophe is prepended: -``` +```sh #!/bin/sh x="aardvark" y="zebra" -if expr "'$x" \< "'$y" > /dev/null +if expr "'$x" \< "'$y" > /dev/null then echo "$x comes before $y in the dictionary" fi