Bash internal instruction set

xiaoxiao2021-03-06  39

BASH Internal Instructions :: [Arguments] Do not do anything, except [arguments] to expand and some specific redirective operations.

Always return zero. Its usage is like TRUE.

************************. FileName [arguments] Source FileName [arguments] reads commands in FileName and executes. You will find a lot of. / Xxxx instructions in /etc/rc.d/*, and XXXX's Permission is not executable. In fact, in TCSH, you need to use Source / XXXX to do the same instruction. Note "." The back is spaced (more ". /" Heel "./", not the same). FileName is a pure text file containing instructions, without Chmod 755 filename.

Example Filename: my_source dev = LO = 127.0.0.1 Netmask = 255.0.0.0 Broadcast = 127.255.255.255

IFCONFIG $ IP NETMASK $ NETMASK BROADCAST $ BROADCAST DEV $ DEV

Next. My_Source or Source My_Source

This script can be implemented without "chmod 755 my_source"

************************* ALIAS [name [= value] ...] nickname command, for example, if you from the world from DOS, Directive to UNIX Not used to, Alias ​​can be used to modify to meet your habits.

Alias ​​ls = "ls --color" alias dir = "ls" alias cd .. = "cd .." alias Copy = "cp -f" # dangerous, recomment, "cp -i" alias del = "RM - f "# dangerous, recomment," rm -i "alias move =" mv -f "# dangerous, recomment," mv -i "alias md =" ​​mkdir "alias rd =" RMDIR "

************************* Unalias [-a] [name ...] UNALIAS cancels Alias ​​settings. "UNALIS -A" will be canceled all Alias.

Example UNALIAS COPY

************************* BG [jobspec] put the specified task into the background, if Jobspec is not specified, the lack is current.

************************ * FG [jobspec] puts the specified task in the foreground if JobSepc is not specified, then it is now current.

************************** JOBS [-lnp] [jobspec ...] first forms list the tasks currently being working. -L: In addition to listing the general information, it also lists the Process IDS. -P: Only Process ID of the work group "head" (Process Group Leader): only lists the status of changed JOBS. If a given Jobspec, the output information is only the JobSpec. The return value is zero unless there is an illegal option.

Jobs -x command [args ...]

If you use the second form (-X), Jobs replaces the specified Command and Args, and performs returning EXIT STATUS.

*********************************** KILL [-S Sigspec | -sigspec] [PID | JOBSPEC] ... send SigSpec's signal to PID or Jobspec. SigSpec can be a form or signal number in Sigkill / Kill. If SIGSPEC is Signal Name, the case is not related, and there is no SIG. Kill -l [Signum] lists the signal name.

[Foxman @ Foxman Bash] # kill -l 1) Sighup 2) SiginT 3) Sigquit 5) Sigill 5) Sigiot 7) Sigbus 8) Sigfpe 9) Sigkill 10) Sigusr1 11) SigSegv 12) Sigusr2 13) Sigpipe 14 Sigalrm 17) SigTerm 17) SigCont 19) Sigstop 20) SigTSTP 21) Sigttin 22) Sigttou 23) Sigurg 24) Sigxcpu 25) Sigxfsz 26) SigvTalRM 27) SigProf 28) Sigwinch 29) SIGWINCH 29) SIGPWR

************************* WAIT [N] Waiting for the specified stroke and returns its end state. n can be a JobSpec or Process ID. If n is not specified, wait for all subunits, and return values ​​to zero. If n is a Job or Process that does not exist, it returns 127. Otherwise, the return value is the last job / process of Exit Status.

************************ BIND [-M keymap] [-lvd] [-q name] bind [-m keymap] -f filename bind [-m KeyMap] Keyseq: function-name shows the key and link function of Readline's button and link function.

-m KeyMap: Set keyMap binding. -L: Displays the name of all Readline function. -V: Show current Function Name and Bindings. -D: Displays Function Name and Bindings. -F filename: Read Key Bindings from FileName. -Q function: Inquiry that button triggers function.

************************* BREAK [N] Jump out of the control back ring for / while / us. If you have a specified N, you jump out of the N layer. n must be greater than or equal to 1. If n is larger than the nest of the nest, all the circles will be jumped. The return value is zero.

************************* Continue [N] Restore Control Round For / While / Until is used. If you have a specified N, the N layer is returned. n must be greater than or equal to 1. If N is larger than the neutral number, restore to the top. The return value is zero. ************************* EXIT [N] leaves the program. n is Exit Status.

************************ RETURN [N] is used in Function. n is the return value, which is the same as EXIT STATUS.

************************* BUILTIN Shell-Builtin [arguments] executes the internal function. When you define the same instructions as the built-in function, this command can be used to perform the internal function.

************************ CD [DIR] replace the directory to DIR. If not specified, the directory specified by Home is set.

********************************** Command [-pvv] Command [arg ...] Specifies to cancel normal shell function to cancel normal shell function with Command. Only built-in commands will be executed. "-p" option, the way the search command is to use PATH. "-V" or "-v" option shows some simple descriptions of the command.

************************* Declare [-frxi] [name [= value]] typeset [-frxi] [name [= value]] announcement Parameters and set attributes. If no name is given, each parameter is displayed.

-f: Use only the function name. -R: Set Name to Readonly. -X: Use the NAME to be used to follow-up environment. -I: This parameter is set to Integer to use, which can be used for arithmetic representation.

When using " ", turn off the property.

************************* DIRS [-L] [ /- n] displays the current memory directory. Directory can be operated by pushd / popd.

N: Display started records n. -N: Record N of the display ends. -L: Show more information.

************************* Echo [-nee] [arg ...] output display ARGS, separated by blank. The return value is always zero.

-n: Do not jump. -E: Interpretation of "/" symbol. -E: Cancel the ESC interpretation function.

"/ a": Alert (Bell), sounds. "/ B": backspace, reverse. "/ C": support trailing newline, no jump line. "/ F": form feed, jump line jump. "/ N": new line, new row. "/ R": carriage return, go back to the line. "/ T": Horizontal Tab, horizontal pitch. "/ V": Vertical Tab, vertical pitch. "//": Output "/". "/ Nnn": Output ASCII Code number nnn (eight into bits).

************************* Enable [-n] [-all] [name ...] boot or turn off the built-in function command. Use "-n" to turn all specified commands, otherwise it is started. If only the "-n" parameter, it will display all the functions. If only "-all", it will display all built-in commands. ************************* EVAL [Arg ...] reads args and combines the args as a command, and then execute. Its return value becomes the return value of EVAL. If there is no parameters, EVAL returns true.

************************* * EXEC [[-] command [arguments]] When the command is executed, the command replaces the shell, no new Process generation . If the first parameter is "-", the shell will put "-" into the zero parameter and pass it to Command.

************************* * EXPORT [-NF] [name [= word]] ... export -p outputs Name to the environment, give Used behind. "-f" option indicates that Name is a function. "-p" shows the name of all exports. "-n" removes Name.

********************************** SET [--abefhkmnptuvxldchp] [-o option] [arg ...] -a: automatically marks the variables as Allows to make it in the back environment. -B: Immediately report the termination background program. -E: When a non-zero value is returned when the command (Simple-Command, see it), immediately jump out. -F: Cancel Pathname Expansion. -H: Find the location of the function command. -K: All Keyword parameters are placed in the environment. -M: Supervision mode. -N: Read the command, but don't execute it. Can be used for syntax checks. -P: Open Privileged mode. -T: leave it immediately when a command is read and executed. -U: When the parameter is expanded, the unset parameter is made as an error. -V: List Shell Input Lines. -X: After opening each Simple-Command, the BASH displays the expansion value on the PS4. -L: Store and restore Name Binding in the For syntax. -D: Close Hasing Command Search. -C: Like the `noclobber =` ` See the internal parameter section. -H: Start! Style History Substitution. -P: Do not follow Symbolic Links when using this command like CD. -: "-", there is no parameters follow. -: Specify all back parameters as a positional parameter. -O option-name: Option-name can be one of the following AlLexport: The same as "-a". BraceExpand: Start Brace Expansion. This is the internal setting. Emacs: Use the Emacs-Style command to edit the interface. Errexit: The same as "-e". Histexpand: The same as "-h". Ignoreeof: The effect is the same as `ignoreeof = 10` Interactive-Commands: Allow # to be a solution. Monitor: The same as "-m". Noclobber: The same as "-C". NOEXEC: The same as "-n". Noglob: The same as "-f". NOHASH: The same as "-d". NOTIFY: The same as "-b". Nounset: The same as "-u". Physical: The same as "-p". POSIX: Bash behavior is modified to POSIX 1003.2 standard. Privileged: The same as "-p". Verbose: The same as "-v". VI: Edit the program using the Vi-style command. Xtrace: The same as "-x". ************************* Unset [-fv] [Name ...] removal is descriptated in Name. Pay attention to PATH, IFS, PPID, PS1, PS2, UID, and EUID cannot unset. If Random, Seconds, Lineno, HistCMD is subjected to the original meaning, which will begin later. The return value is TRUE unless Name cannot be subjected to Unset.

************************* FC [-e ename] [-nlr] [first] [last] fc -s [PAT = rep] [ CMD] Correction Command.

************************ Getopts optstring name [args] resolve location parameters. ************************ Help [Pattern] Display assistance information.

************************ HISTORY [N] History -rwan [filename] When there is no parameter, the history of the down command is displayed. With parameter "n", the last N is displayed.

Other parameters are as follows: -a: New "New History" into the historical file. -N: The reading has not read the record in history. -R: Read filename as historical files and use it for current history. -W: Write existing history into filename.

************************* Let Arg [Arg ...] arithmetic representation. Please refer to the arithmetic representation section.

************************* LOCAL [Name [= value] ...] produces a local parameter. If used for Function, its effect is surrounded in function and its subunies.

************************ LOGOUT leaving the Login Shell.

************************* POPD [ /- n] removes the directory stack. " N" Removes the above N, "- N" removes the following n.

************************ Pushd [Dir] Pushd /- n Added the directory to the top of the directory stack. " N" rotates the stack to make the nth directory become the top. "-n" rotates the stack to make the countdown nth directory becomes the top.

************************* PWD lists the absolute path of current working directory.

************************* READ [-r] [name ...] read into one line, then the first word is set to the first one Name, the second set to the second Name, so on. If there is no NAME in the parameter, the READ will set the value to reply. The return value is zero unless END-OF-FILE is encountered. If there is a "-r" option, "/ N" is considered as part of the line.

********************************* READONLY [-f] [name ...] readonly -p The given name is marked as Readonly. If it is a "-f" option, the function is also marked as Readonly. "-p" will list all readonly's Name. "-" Cancel the remaining parameters.

************************ Shift [N] Positional Parameters starts from N 1 ... will be changed to $ 1 .... If n is zero, there is no change. n If not given, it is within 1. n must be non-negative and less than or equal to $ #. If n is greater than $ #, there is no change. The return value is zero, unless n is greater than $ # or less than zero.

********************************** SUSPEND [-f] Pause this shell's execution until it receives a sigcont signal. The "-f" option is called the login shell. Don't complain, but it is still as paused. Returns status zero unless the shell is a login shell, and there is no "-f" option.

************************ TEST EXPR [expr] We have already said in the exit status, no longer heavy. ************************* Times is listed in the accumulated user and system time of the shell and the process time executed from the shell, the return value is zero .

-------------------------------------------------- ---------------------------- Trap [-L] [arg] [SigSpec] When receiving the SigSpec signal, the arg command is executed. "-L" displays the signal name and number.

************************ TYPE [-All] [-type | -path] name [name ...] without parameters, It will display the shell to interpret Name as a command. If there is "-type", it will display Alias, Keyword, Function, Builtin or File. If there is a "-Path" parameter, it will display the path of the command, if you can't find it, do not display anything. If there is a "-all" parameter, it will display all possible paths that can perform NAME. TYPE accepts "-a", "- t", "- p" as an abbreviation.

************************* ULIMIT [-SHACDFMSTPNUV [limited] ULIMIT provides the ability to obtain resource control for the shell.

-A: Report all restrictions. -C: Set the maximum generated Core file. -D: The maximum value of the Process's Data Segment. -F: The largest file can be generated by this shell. -M: Resident Set size maximum. -S: Stack maximum. -T: CPU Time maximum (in seconds). -P: The maximum of Pipe Size in 512-Byte Blocks. -N: The maximum File Descriptor can be opened. -U: The maximum number of processs that a single user can use. -V: The maximum virtual memory available value for this shell.

All items are units in 1024.

************************* UMASK [-S] [Mode] sets the user's File-Creation Mask to Mode. "-S" option prints Mask into symbolic forms.

转载请注明原文地址:https://www.9cbs.com/read-63147.html

New Post(0)