pls can anyone explain what does ${1} means? what if i have i have two arguments and have {2} added to the if cond? any links to get this claruified on the syntax?
$1 is the first argument, $2 is the second argument, etc.
If the script is run with ./script.sh arg1 arg2 "arg 3" arg4
then $1 is arg1, $2 is arg2, $3 is arg 3, $4 is arg4, etc.
So they're just testing if it got called with any argument at all and, if it was, sets the variable DATETIME to it.
The special variable $# can be useful, it tells you how many arguments you have. He could have checked if [ $# -gt 0 ] instead of checking if $1 was empty.