Last active
February 8, 2020 04:26
-
-
Save RichardBronosky/04f3b830532ba8ba60f35b22752d88f2 to your computer and use it in GitHub Desktop.
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/bash | |
# curl -sL https://gist.github.com/RichardBronosky/04f3b830532ba8ba60f35b22752d88f2/raw/curl-bash-env | bash | |
cat <<EOF | less | |
# stdin_is_a_pipe | |
[[ -p /dev/stdin ]]; echo \$? | |
$([[ -p /dev/stdin ]]; echo $?) | |
# stdin_is_a_tty | |
[[ -t 0 ]]; echo \$? | |
$([[ -t 0 ]]; echo $?) | |
# ps -o pid,ppid,command \$\$ #($$) | |
$(ps -o pid,ppid,command $$) | |
# ps -o pid,ppid,command \$PPID #($PPID) | |
$(ps -o pid,ppid,command $PPID) | |
# ps -o pid,ppid,command | |
$(ps -o pid,ppid,command) | |
0 = $0 | |
1 = $1 | |
2 = $2 | |
3 = $3 | |
4 = $4 | |
5 = $5 | |
6 = $6 | |
7 = $7 | |
8 = $8 | |
9 = $9 | |
10 = $10 | |
############### | |
############### | |
#### env #### | |
############### | |
############### | |
$(env) | |
############### | |
############### | |
#### set #### | |
############### | |
############### | |
$(set) | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment