home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / strings / c_string / shar.sh < prev    next >
Encoding:
Text File  |  1986-04-09  |  967 b   |  49 lines

  1.  
  2. /*f File   : shar.arc
  3.  
  4. #!/bin/sh
  5. append=0
  6. if test $1 = -a
  7.     then
  8.         append=1
  9.         shift
  10.     fi
  11. verbose=0
  12. if test $1 = -v
  13.     then
  14.         verbose=1
  15.         shift
  16.     fi
  17. sharchive=sharchive
  18. if test $1 = -o
  19.     then
  20.         sharchive=$2
  21.         shift; shift
  22.     fi
  23. if test $# = 0
  24.     then
  25.         echo "Usage: shar [-a] [-v] [-o sharchive] file..."
  26.         exit
  27.     fi
  28. if test $append = 0
  29.     then
  30.         echo "#!/bin/sh" >$sharchive
  31.     fi
  32. for file in $*
  33.     do
  34.         if test "$file" != "$sharchive"
  35.             then
  36.                 if test $verbose = 1
  37.                     then
  38.                         echo archiving $file
  39.                     fi
  40.                 echo "cat >$file <<'------ EOF ------'" >>$sharchive
  41.                 cat $file >>$sharchive
  42.                 echo "------ EOF ------" >>$sharchive
  43.                 echo "ls -l $file" >>$sharchive
  44.             fi
  45.     done
  46. chmod +x $sharchive
  47. */
  48.  
  49.