#!/bin/bash if [ $# -eq 0 ] then echo "Jiri Kucera, A04321" elif [ $# -eq 1 ] then if [ $1 = -w ] then cat skript | tee a04321.sh | head -n 5 echo 'Skript zapsan do souboru a04321.sh' fi elif [ $# -gt 4 ] then echo "Vice nez 4 parametry" if [ $# -gt 6 ] then echo "Dokonce vice nez 6" fi elif [ $1 = -d ] then if [ $# -eq 4 ] then echo "adresare v $2:" for adr in $2/* do if test -d $adr then echo $adr fi done if [ -d $4 ] then echo Adresar $4 existuje else echo "Adresar $4 neexistuje, bude vytvoren" mkdir $4 fi I=0 cd $3 for S in *.txt do if [ $I -lt 2 ] then cp $S ../$4/${S}.bak echo "$S zalohovano do $4" fi I=$[I+1] done cd .. else echo "skript -d " fi fi