2020-10-23 12:00:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Show type & contents of given files or PWD
|
2020-11-16 11:29:31 +00:00
|
|
|
for last; do true; done
|
|
|
|
last=${last:-.}
|
|
|
|
file "$last" | grep -v --color=never directory
|
|
|
|
case "$(file --dereference --mime "$last")" in
|
|
|
|
*inode/directory*) ls -l --color=auto --human-readable --group-directories-first --file-type --dereference-command-line --all --reverse "$@";;
|
|
|
|
*binary) ;;
|
2020-11-22 18:55:59 +00:00
|
|
|
*) $(test -r "$last" && echo "bat" || echo "sudo bat") --style header "$@";;
|
2020-11-16 11:29:31 +00:00
|
|
|
esac
|