Let's say I have a bash script called
log.sh. In this script, I want to read in input from a pipe, but I also want to know the command used to pipe input into me. Example:
tail -f /var/log/httpd/error | log.sh
In the shell script, I want to know the command
tail -f /var/log/httpd/error.