X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=examples%2Fscripts.v2%2Fuuenc;fp=examples%2Fscripts.v2%2Fuuenc;h=0000000000000000000000000000000000000000;hb=8eb22ee966b0276194bbda0d6c8b109f4636edd3;hp=480aa48e3e35ce7bc206c50de2472172583db629;hpb=899fe729a6aca21cd73c58290b910ca7d58b0bf8;p=thirdparty%2Fbash.git diff --git a/examples/scripts.v2/uuenc b/examples/scripts.v2/uuenc deleted file mode 100644 index 480aa48e3..000000000 --- a/examples/scripts.v2/uuenc +++ /dev/null @@ -1,69 +0,0 @@ -#! /bin/bash -# -# original from: -# @(#) uuenc.ksh 1.0 93/09/18 -# 93/09/18 john h. dubois iii (john@armory.com) -# -# conversion to bash v2 syntax by Chet Ramey - -istrue() -{ - test 0 -ne "$1" -} - -isfalse() -{ - test 0 -eq "$1" -} - -phelp() -{ -echo "$name: uuencode files. -$Usage -For each filename given, $name uuencodes the file, using the final -component of the file's path as the stored filename in the uuencoded -archive and, with a .${SUF} appended, as the name to store the archive in. -Example: -$name /tmp/foo -The file /tmp/foo is uuencoded, with \"foo\" stored as the name to uudecode -the file into, and the output is stored in a file in the current directory -with the name \"foo.${SUF}\". -Options: --f: Normally, if the file the output would be stored in already exists, - it is not overwritten and an error message is printed. If -f (force) - is given, it is silently overwritten. --h: Print this help." -} - -name=${0##*/} -Usage="Usage: $name [-hf] ..." -typeset -i force=0 - -SUF=uu - -while getopts :hf opt; do - case $opt in - h) phelp; exit 0;; - f) force=1;; - +?) echo "$name: options should not be preceded by a '+'." 1>&2 ; exit 2;; - ?) echo "$name: $OPTARG: bad option. Use -h for help." 1>&2 ; exit 2;; - esac -done - -# remove args that were options -shift $((OPTIND - 1)) - -if [ $# -lt 1 ]; then - echo "$Usage\nUse -h for help." 1>&2 - exit -fi - -for file; do - tail=${file##*/} - out="$tail.${SUF}" - if isfalse $force && [ -a "$out" ]; then - echo "$name: $out: file exists. Use -f to overwrite." 1>&2 - else - uuencode $file $tail > $out - fi -done