[ $(date +%m) -gt 2 ] && \
echo rm -r "${BACKUP_ROOTDIR}/mysql/$(date +%Y)/$(( $(date +%m) - 2 ))/" || \
echo rm -r "${BACKUP_ROOTDIR}/mysql/$(( $(date +%Y) - 1 ))/$(( $(date +%m) ++ 10 ))/"
while :
do
ssh -R localhost:2222:localhost:22 root@myhost
done
{ ftp -inv SERVER << EOF
user USER PASSWORD
cd DIRECTORY
ls -R
bye
EOF
} | sed '/^[d-]/!d;s/^\(.\).*/\1/' | sort | uniq -c | sed 's/-/files/;s/d/directories/'
echo -e "111\n222\n111\n333\n123" | uniq -d
echo -e "111\n222\n111\n333\n123" | sort | uniq -d
wget -qO - server/tree.rar | tar -xf -
If bash is waiting for a command to complete and receives a signal for which a trap has been set, the trap will not be executed until the command completes. When bash is waiting for an asynchronous command via the wait builtin, the reception of a signal for which a trap has been set will cause the wait builtin to return immediately with an exit status greater than 128, immediately after which the trap is executed.