Pl explain the shell script code

if [ ${1:-0} == "-r" ]
then
ROLLBACK=1 ;
elif [ ! "$packet" ]
then
echo "Nothing to install!" ;
echo "Exiting." ;
exit 0;

Plz explaing what is the ${1:-0} in if loop?:slight_smile:

this looks like portion of a shell script... :confused:
where did you get this from?

i just need to understand what is the conditional expression in if ... thanks

That conditional expression is partly pointless as "0" can never be equal to "-r".

It is equivalent to:

if [ "$1" = "-r" ]