summaryrefslogtreecommitdiff
path: root/bin/zat
diff options
context:
space:
mode:
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