$1 - $9 these variables are the positional parameters.
$0 the name of the command currently being executed.
$# the number of positional arguments given to this
invocation of the shell.
$? the exit status of the last command executed is
given as a decimal string. When a command
completes successfully, it returns the exit status
of 0 (zero), otherwise it returns a non-zero exit
status.
$$ the process number of this shell - useful for
including in filenames, to make them unique.
$! the process id of the last command run in
the background.
$- the current options supplied to this invocation
of the shell.
$* a string containing all the arguments to the
shell, starting at $1.
$@ same as above, except when quoted.
Notes
$*
and $@
when unquoted are identical and expand into the
arguments.
"$*"
is a single word, comprising all the arguments to the
shell, joined together with spaces. For example '1 2' 3
becomes "1 2 3"
.
"$@"
is identical to the arguments received by the shell, the
resulting list of words completely match what was given
to the shell. For example '1 2' 3
becomes "1 2" "3"
分享到:
相关推荐
Special Shell Variables B-2. TEST Operators: Binary Comparison B-3. TEST Operators: Files B-4. Parameter Substitution and Expansion B-5. String Operations B-6. Miscellaneous Constructs C-1. Basic sed...
Special Shell Variables B-2. TEST Operators: Binary Comparison B-3. TEST Operators: Files B-4. Parameter Substitution and Expansion B-5. String Operations B-6. Miscellaneous Constructs C-1. Basic sed...
Introducing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 Introducing Quoting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Shell Programming! .........................................................................................................................1 Chapter 2. Starting Off With a Sha-Bang.....................
Chapter 1: Starting with Fedora Linux ....Appendix B: Shell Special Characters and Variables . . . .271 Appendix C: Getting Information from /proc . . . . . .275 Index . . . . . . . . . . . . . . 281
各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ 一、注意事项 命令和参数之间必需用空格隔开,参数和参数之间也必需用空格隔开。 一行不能超过256个字符;大小写有区分。 二、特殊字符...
To get an element property value (shell thickness) for a specific element 150 To get a material property value 152 To get a list of all groups 153 To get the nodes and elements associated to the ...
r Shell commands GDB Commands r Command syntax r Command completion r Getting help Running Programs Under GDB r Compiling for debugging r Starting your program r Your program's arguments r Your ...
About_automatic_variables.help.txt About_break.help.txt About_command_search.help.txt About_command_syntax.help.txt About_comparison_operators.help.txt About_continue.help.txt About_core_commands.help...
Memory Layout and Access 4.0 - Chapter Overview 4.1 - The 80x86 CPUs:A Programmer's View 4.1.1 - 8086 General Purpose Registers 4.1.2 - 8086 Segment Registers 4.1.3 - 8086 Special ...
xvii Contents Finishing Your Modules 154 Defining Module-Specific Errors 154 Choosing What to Export ...CGI’s Special Environment Variables 471 Accepting User Input through HTML Forms 473 The cgi ...
1.1 What's Special About UNIX?............................................................................................................2 ...............................................................
Shell Execution of Programs Section 9.10. Orphaned Process Groups Section 9.11. FreeBSD Implementation Section 9.12. Summary Exercises Chapter 10. Signals Section 10.1. ...
9.9 Shell Execution of Programs 303 9.10 Orphaned Process Groups 307 9.11 FreeBSD Implementation 310 9.12 Summary 312 Chapter 10. Signals 313 10.1 Introduction 313 10.2 Signal Concepts 313 10.3 signal...
Delegating Special Methods in Proxies Recipe 6.7. Implementing Tuples with Named Items Recipe 6.8. Avoiding Boilerplate Accessors for Properties Recipe 6.9. Making a Fast Copy of an Object ...
一本深入学习shell脚本艺术的书籍 非常好的书 强烈推荐 附有超多实例 Advanced Bash-Scripting Guide............................................................................................................
Operators And Special Methods Builtins Build and C API Changes Performance Porting To Python 3.0 What’s New in Python 2.7 The Future for Python 2.x Changes to the Handling of Deprecation ...
The directory verify/ contains a small set of verification pictures, a small bitstream, and Unix shell script to automatically test the output of the encoder and decoder. <br>A precompiled ...
+ Leapyear code fixed because the DS sucks at reporting variables nicely. + Updated German language (moviecut). + Reset more of arm7 before runing a game (Thanks Gelu). + 3in1+ Fix for Opera (Untested...