From 24f05d05cdda3aafbb6218aa180d99a86b7e218e Mon Sep 17 00:00:00 2001 From: onceupon Date: Wed, 29 Mar 2017 17:48:14 +0800 Subject: [PATCH] add handy environment variables --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index cf558a8..5819df5 100644 --- a/README.md +++ b/README.md @@ -1327,6 +1327,15 @@ cat file|rev | cut -d/ -f1 | rev ((var++)) ``` +##### some handy environment variables +$0 :name of shell or shell script.   +$1, $2, $3, ... :positional parameters.   +$# :number of positional parameters.   +$? :most recent foreground pipeline exit status.   +$- :current options set for the shell.   +$$ :pid of the current shell (not subshell).   +$! :is the PID of the most recent background command.   + ## System [[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]