summaryrefslogtreecommitdiff
path: root/bin/zat
diff options
context:
space:
mode:
authorHorus32015-08-18 11:43:51 +0200
committerHorus32015-08-18 11:43:51 +0200
commit4a5a08dcc6cf209203efccad9cc2714beb9fdb50 (patch)
tree251c7ddd10fb470110b8ace234cefbf97b8e354a /bin/zat
parent5018d9f3aadfcbbac3c41c142fc2a29caac38b12 (diff)
downloaddotfiles-4a5a08dcc6cf209203efccad9cc2714beb9fdb50.tar.gz
Add zat and nwhois.
Diffstat (limited to 'bin/zat')
-rwxr-xr-xbin/zat20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/zat b/bin/zat
new file mode 100755
index 0000000..0d2ae17
--- /dev/null
+++ b/bin/zat
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 [FILES]"
+ echo
+ echo "$0 is both cat as zcat."
+fi
+
+while [ $# -ne 0 ]; do
+ case "$1" in
+ *.gz)
+ zcat "$1"
+ shift
+ ;;
+ *)
+ cat "$1"
+ shift
+ ;;
+ esac
+done