From 3fdacebc05cc8c99fc5164caaba6a994be9c6247 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Tue, 29 Jul 2025 10:20:20 +0900 Subject: [PATCH] Updated SC3012 (markdown) --- SC3012.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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