#!/bin/bash cache="" # Parse arguments. while (( $# > 0 )); do case "$1" in -c) shift cache=$1 shift ;; esac done # If cache file isn't expected path, return error. if ! [[ $cache =~ \/tmp\/krb5_cache_.* ]]; then echo "klist: No credentials cache found (filename: $cache)" exit 1 fi # Return basic klist response. cat <