Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Last active February 8, 2020 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichardBronosky/04f3b830532ba8ba60f35b22752d88f2 to your computer and use it in GitHub Desktop.
Save RichardBronosky/04f3b830532ba8ba60f35b22752d88f2 to your computer and use it in GitHub Desktop.
#!/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