Ive come across the code
if [ $# -eq 1 ]; then
echo "usage: Phar ~/flashmem ~/archive"
exit
fi
Ive never come across [ $# -eq 1 ]; before and I cant seem to find a meaning
Ive come across the code
if [ $# -eq 1 ]; then
echo "usage: Phar ~/flashmem ~/archive"
exit
fi
Ive never come across [ $# -eq 1 ]; before and I cant seem to find a meaning
The "$#" return the number of parameters passed as argument
Now
this return
3
this return
5
So in your code if "$#" equal the number one (just one argument passed), execute the echo command
It
Expands to the number of positional parameters in decimal.
(copied from
man bash
, under Special Parameters).