list all dirs+subdirs = find ./ -type d zip and delete a dir find ./ | xargs zip -m /compressed.zip while shift nextSwitch = $0 if switch = -H then blnShowHelp true if siwtch = -x then blnDecompressFile = true shift txtFileToDecompress = $0 end if end while bash and perl follow same lines... actually perl assumes that each function could have been originally a stand alone shell script, so all function params follow the shift/$1 idea.. function doDoodad { my $FirstParam = shift; my $SecondParam = shift; or function doDoodad { my $FirstParam = $1; my $SecondParam = $2;