dotfiles/.local/bin/b

18 lines
466 B
Plaintext
Raw Normal View History

#!/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
case "$(file --dereference $arg)" in
*directory) ls -l --color=auto --almost-all --human-readable --group-directories-first --file-type --dereference-command-line "$@";;
*text*) bat --style header "$@";;
esac
#fi