#!/bin/csh -fb # # by Marina Candusso 20/05/97 (Created for JHEP @ SISSA) # ############################################################################### ## webpac ## Creates your tarred archive using on UNIX machines ## ## following your given options for Z/gzip compression. ## ## Further info at http://jhep.sissa.it/ ## ## or your nearest JHEP node. ############################################################################### # Usage: # Download this UNIX shell script (with name = webpac) in your favorite dir # and execute the following commands: # chmod +x webpac # ./webpac ##################### # ..then answer to every question webpac will ask to you. #################################### set ECHO = /bin/echo $ECHO "use gzip for compression?:(y/n) \c " set gzcomp=$< if ("$gzcomp" == "y") then set suffix=gz comp=(gzip -9 -f -c) text="gzip" $ECHO will use gzip to compress else $ECHO "use Z-compression?:(y/n) \c " set Zcomp=$< if ("$Zcomp" == "y") then set suffix=Z comp=(compress -f -c) text="compress" $ECHO will use Z-compression else $ECHO Sorry, no more options with this program... exit endif endif # # $ECHO "Now change directory to where your files are located e.g: ~/myarchive (press for current dir): \c " set archdir=$< if ("$archdir" == "") then set archdir=`pwd` else cd $archdir endif # if (! -d $archdir) then $ECHO Sorry, unable to find $archdir exit endif $ECHO "OK we are now in directory:" `pwd` $ECHO "" $ECHO Enter files to put in the archive: $ECHO "(e.g:*)" will include all files $ECHO "(e.g:*.ps file.tex)" will include all files with "ps" extension and file.tex $ECHO "(e.g: file1.ps file2.ps file.tex)" for file selection $ECHO "Please enter your list: \c" set list=$< # foreach fff ($list) if (! -e $fff) then $ECHO I cannot find $fff exit 1 endif end if (`$ECHO $list | wc -w` == 1 && -e `$ECHO $list`) then $ECHO You have selected the single file: $ECHO $list set pacname=$list:t tarsuffix="" tar="cat" text1="" else if (`$ECHO $list | wc -w` > 1) then set tar = "tar cf -" tarsuffix=".tar" text1="tar and" $ECHO multiple files selection: $ECHO $list $ECHO "---" $ECHO 'Select a file "name" for your final archive (it will come out as "name".tar.'$suffix'): \c ' set pacname=$< endif endif $ECHO "---" chmod 644 $list $ECHO $text1 $text your $list. $ECHO Building $pacname$tarsuffix.$suffix $ECHO Please wait.. $tar $list | $comp > $pacname$tarsuffix.$suffix $ECHO "---" $ECHO "---" $ECHO file compression done. chmod 755 $pacname$tarsuffix.$suffix $ECHO Your archive $pacname$tarsuffix.$suffix is now ready for Web uploading. $ECHO Bye... exit