2020-10-23 12:00:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Show type & contents of given files or PWD
|
|
|
|
|
|
|
|
#if test $# -gt 1
|
|
|
|
#then
|
|
|
|
# for arg in "$@"; do
|
|
|
|
# b --pager=never "$arg"
|
|
|
|
# done
|
|
|
|
#else
|
|
|
|
arg=$(test $# -gt 0 && echo "${@:-1}" || echo .)
|
|
|
|
file $arg | grep -v --color=never directory
|
2020-11-13 12:33:01 +00:00
|
|
|
case "$(file --dereference --mime $arg)" in
|
2020-10-23 20:17:58 +00:00
|
|
|
*directory) ls -l --color=auto --almost-all --human-readable --group-directories-first --file-type --dereference-command-line "$@";;
|
2020-11-13 12:33:01 +00:00
|
|
|
*binary*) ;;
|
|
|
|
*) bat --style header "$@";;
|
2020-10-23 12:00:41 +00:00
|
|
|
esac
|
|
|
|
#fi
|