질문이 있으신가요?
#!/usr/local/bin/bash
REF_FILE_NUM="000000010000001900000052"
for id in `ls -1 dir` ;
do
FILE_NUM=${id:0:24}
echo "FILE_NUM: $FILE_NUM ; REF_FILE_NUM: $REF_FILE_NUM"
if [[ "$FILE_NUM" < "$REF_FILE_NUM" ]]
then
echo "$FILE_NUM lt $REF_FILE_NUM"
echo ""
else
echo "$FILE_NUM gt $REF_FILE_NUM"
echo ""
fi
done
freebsd# ./test.sh
FILE_NUM: 0000000100000019000000FF ; REF_FILE_NUM: 000000010000001900000052
0000000100000019000000FF gt 000000010000001900000052
FILE_NUM: 0000000100000020000000FF ; REF_FILE_NUM: 000000010000001900000052
0000000100000020000000FF gt 000000010000001900000052
FILE_NUM: 0000000100000021000000FF ; REF_FILE_NUM: 000000010000001900000052
0000000100000021000000FF gt 000000010000001900000052
답변1
모든 것은 결국
[[ F > 5 ]] && [[ 2 > 1 ]]
ASCII에서는 F
70(0x46) 5
이지만 .
어떤 결과를 기대하며 그 이유는 무엇입니까?