Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
5
Добавлен:
26.05.2014
Размер:
646 б
Скачать

#!/bin/sh
if test $# -eq 0
then
echo "Input directory '.' for current directory:"
read dir
echo $dir
$0 $dir
else
for name in $@
do
if test -d $name
then
echo "input suffix:"
read suf
(cd $1
echo "Current directory is:"; pwd
ls | (while read name
do
if test -d $name
then
echo "Now searching in directory: $name"
full=' '
for c in *.$suf
do
if test -e $c
then
full="$full $c"
fi
done
if test #full
then
touch output.rar
tar -z -c -f output.tar $full
fi
($0 $name)
fi
done
)
)
else
echo "error: input name isn't directory name"
fi
done
fi
Соседние файлы в папке shell