I am a rank newbie who is trying to get my very first "if then" statement to work. I concocted a total bs situation to use as a trial but it does not work. I have read about a half doz descriptions about how to format an if then but I get no clue about what I might be doing wrong.
my script:
#!/bin/bash
if [ 10 > $1 ]
then
printf "Too big\n"
else
printf "Too small\n"
fi
I figured I could provide any number as the first parameter at the command line and the script would tell me an appropriate answer. No joy. All I ever get at the cmd line is:
Johns-iMac:~ johnyoung$ ./test3 5
Too big
Johns-iMac:~ johnyoung$ ./test3 50
Too big
For the practice I have been doing this script ended up being called "test3"
Any body able to help me out? Thanks loads.