3 #==============================================================================
5 # File ID: 2a4e251e-7b6f-11df-b25f-00219bfade9b
7 # Pack stdin with gzip and encapsulate it in base64.
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #==============================================================================
24 while test -n "$1"; do
26 -d|
--decode) opt_decode
=1; shift ;;
27 -h|
--help) opt_help
=1; shift ;;
28 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
29 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
30 -w) opt_w
="$2"; shift 2 ;;
31 --version) echo $progname $VERSION; exit 0 ;;
34 if printf '%s\n' "$1" |
grep -q ^
-; then
35 echo "$progname: $1: Unknown option" >&2
43 opt_verbose
=$
(($opt_verbose - $opt_quiet))
45 if test "$opt_help" = "1"; then
46 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
49 Pack stdin with gzip and encapsulate it in base64.
51 Usage: $progname [options]
56 Decode gzipped base64.
60 Be more quiet. Can be repeated to increase silence.
62 Increase level of verbosity. Can be repeated.
64 Create base64 using SIZE character chunks. To get one long chunk,
65 use 0. Default: $std_w.
67 Print version information.
73 if [ "$opt_decode" = "1" ]; then
74 base64
-di | gunzip
--stdout --force
78 gzip -9 | base64
-w $opt_w |
tr '\n' ' ' |
sed 's/ $//'
81 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :