clueless
public text v1 · immutabletarview () { echo -n "Displaying contents of $1 "; if [ ${1##*.} = tar ]; then echo "(uncompressed tar)"; tar tvf $1; else if [ ${1##*.} = gz ]; then echo "(gzip-compressed tar)"; tar tzvf $1; else if [ ${1##*.} = bz2 ]; then echo "(bzip2-compressed tar)"; cat $1 | bzip2 -d | tar tvf -; fi; fi; fi}