-
-
Save lersveen/fc974e003171ec97647f5594ba83a00a to your computer and use it in GitHub Desktop.
I am so sorry.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# such file inspector, much doge | |
# | |
self() { | |
cat <<EOF | |
Wow | |
Such self | |
Much recursion | |
▄ ▄ | |
▌▒█ ▄▀▒▌ | |
▌▒▒█ ▄▀▒▒▒▐ | |
▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐ | |
▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐ | |
▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌ | |
▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌ | |
▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐ Very doge | |
▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌ | |
▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌ | |
▌▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐ | |
▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌ | |
▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐ | |
▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌ | |
▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐ | |
▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌ | |
▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀ | |
▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀ | |
▒▒▒▒▒▒▒▒▒▒▀▀ | |
EOF | |
} | |
if test -f "$1"; then # True if file exists and is a regular file. | |
if ! test -r "$1"; then # True if file exists and is readable. | |
echo "such file, no read" | |
elif test -s "$1"; then # True if file exists and has a size greater than zero. | |
if test -x "$1"; then # True if file exists and is executable. | |
if [ "$(realpath "$0")" = "$(realpath "$1")" ]; then | |
self | |
else | |
echo "much file, very execute" | |
fi | |
elif test -w "$1"; then # True if file exists and is writable. | |
echo "much file, many writes" | |
else | |
echo "much file" | |
fi | |
else | |
echo "such file, very empty" | |
fi | |
elif test -L "$1"; then # True if file exists and is a symbolic link. | |
echo "very symlink, much wow" | |
elif test -d "$1"; then # True if file exists and is a directory. | |
echo "such directory" | |
elif test -S "$1"; then # True if file exists and is a socket. | |
echo "Such socket, many wow" | |
elif test -e "$1"; then # True if file exists (regardless of type). | |
echo "Such file, very mystery" | |
else | |
echo "very nope" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment