User Tools

Site Tools


characters-and-expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
characters-and-expressions [2019/10/07 22:32]
Miroslav Bernát
characters-and-expressions [2019/10/08 00:37] (current)
Miroslav Bernát
Line 25: Line 25:
 | **$**<​n>​ / **${**<​n>​**}** | the value of a numeric parameter\\ ''​$ ./backup.sh /​media/​disk-1''​\\ (determines the device where the backup is made; the script includes e.g. „target_dir="​$1"​”) | | **$**<​n>​ / **${**<​n>​**}** | the value of a numeric parameter\\ ''​$ ./backup.sh /​media/​disk-1''​\\ (determines the device where the backup is made; the script includes e.g. „target_dir="​$1"​”) |
 | **Special parameters:​** | **parameters whose contents can only be read** | | **Special parameters:​** | **parameters whose contents can only be read** |
-| **$**<​parameter>​ / **${**<​parameter>​**}** | the value of a special parameter\\ **$#** within the script represents the number of command-line arguments passed to the script, **$*** or **$@** within the script represents all the command-line arguments passed to the script (when "​$*"​ is used, all of the arguments are seen as a single word, however when "​$@"​ is used, each argument is seen as a separate word), **$0** within the script represents the name of the shell script, on the command line it represents the name of the current shell, **$$** represents the PID of the current shell, **$?** represents the return code of the previous foreground process, **$!** represents the PID of the last background process |+| **$**<​parameter>​ / **${**<​parameter>​**}** | the value of a special parameter\\ **$#** within the script represents the total number of command-line arguments passed to the script, **$*** or **$@** within the script represents all the command-line arguments passed to the script (when "​$*"​ is used, all of the arguments are seen as a single word, however when "​$@"​ is used, each argument is seen as a separate word), **$0** within the script represents the name of the shell script, on the command line it represents the name of the current shell, **$$** represents the PID of the current shell, **$?** represents the return code of the previous foreground process, **$!** represents the PID of the last background process |
 | **REDIRECTION CHARACTERS** | **redirect the standard input / output / error of a command** | | **REDIRECTION CHARACTERS** | **redirect the standard input / output / error of a command** |
 | **<** / **0<** | standard input redirection (STDIN / file descriptor 0)\\ ''​$ mail tom@atlas.cz < list.txt''​ | | **<** / **0<** | standard input redirection (STDIN / file descriptor 0)\\ ''​$ mail tom@atlas.cz < list.txt''​ |
Last modified: 2019/10/08 00:37 by Miroslav Bernát

visits: