Sunteți pe pagina 1din 1

#/bin/bash if [$# -eq 3]; then if[-e "$1"];then if[-e "$2"];then if[-e "$3"];then read -p "want to overwrite file

$3? y/n" option; if [$option = "n"]|| [$option = "N"]; then exit 1; fi if [$option = "y"]|| [$option = "Y"]; then cat $1 > $3; cat $2 >> $3; echo join file $1 and $2 to $3 success; else echo invalid input; exit 1; fi else cat $1 $2 > $3 fi else echo file $2 doesnt exist; fi else echo file $1 doesnt exist; fi elif [$# -lt 3]; then echo you must type more parameter; ./join file1 file2 file3 else echo too many parameter $#; fi

S-ar putea să vă placă și