You are not logged in.
Pages: 1
hi
I found a script, with this code:
...
if [ $LOGIT -eq 1 ]
then
echo "[LOG] Checking if backup folders exist, if not then create them."
fi
if [ -d $BACKUPDIR ]
then
echo -n < /dev/null
else
mkdir "$BACKUPDIR"
if [ $LOGIT -eq 1 ]
then
echo "[LOG] Created Folder: $BACKUPDIR"
fi
fi
...
but I don't understand why there is the "echo -n < /dev/null".
Offline
Whoever wrote it, didn't know about conditional bangs (aka logical negation), and wanted to not do anything when a condition was true.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1