Tru reference manual


















The result is supplied as a single string, with a newline appended, to the command on its standard input or file descriptor n if n is specified. If word expands to one or more digits, the file descriptor denoted by n is made to be a copy of that file descriptor. If the digits in word do not specify a file descriptor open for input, a redirection error occurs. If n is not specified, the standard input file descriptor 0 is used. If n is not specified, the standard output file descriptor 1 is used.

If the digits in word do not specify a file descriptor open for output, a redirection error occurs. If the file does not exist, it is created. When a simple command is executed, the shell performs the following expansions, assignments, and redirections, from left to right, in the following order.

If no command name results, the variable assignments affect the current shell environment. Otherwise, the variables are added to the environment of the executed command and do not affect the current shell environment. If any of the assignments attempts to assign a value to a readonly variable, an error occurs, and the command exits with a non-zero status.

If no command name results, redirections are performed, but do not affect the current shell environment. A redirection error causes the command to exit with a non-zero status.

If there is a command name left after expansion, execution proceeds as described below. Otherwise, the command exits. If one of the expansions contained a command substitution, the exit status of the command is the exit status of the last command substitution performed.

If there were no command substitutions, the command exits with a status of zero. After a command has been split into words, if it results in a simple command and an optional list of arguments, the following actions are taken. When a simple command other than a builtin or shell function is to be executed, it is invoked in a separate execution environment that consists of the following. Unless otherwise noted, the values are inherited from the shell.

Command substitution, commands grouped with parentheses, and asynchronous commands are invoked in a subshell environment that is a duplicate of the shell environment, except that traps caught by the shell are reset to the values that the shell inherited from its parent at invocation.

Builtin commands that are invoked as part of a pipeline are also executed in a subshell environment. Subshells spawned to execute command substitutions inherit the value of the -e option from the parent shell. Otherwise, the invoked command inherits the file descriptors of the calling shell as modified by redirections.

When a program is invoked it is given an array of strings called the environment. Bash provides several ways to manipulate the environment. On invocation, the shell scans its own environment and creates a parameter for each name found, automatically marking it for export to child processes.

Executed commands inherit the environment. If the value of a parameter in the environment is modified, the new value becomes part of the environment, replacing the old. The environment for any simple command or function may be augmented temporarily by prefixing it with parameter assignments, as described in Shell Parameters. These assignment statements affect only the environment seen by that command. If the -k option is set see The Set Builtin , then all parameter assignments are placed in the environment for a command, not just those that precede the command name.

The exit status of an executed command is the value returned by the waitpid system call or equivalent function. Exit statuses fall between 0 and , though, as explained below, the shell may use values above specially. Exit statuses from shell builtins and compound commands are also limited to this range.

Under certain circumstances, the shell will use special values to indicate specific failure modes. A non-zero exit status indicates failure.

This seemingly counter-intuitive scheme is used so there is one well-defined way to indicate success and a variety of ways to indicate various failure modes. If a command is not found, the child process created to execute it returns a status of If a command is found but is not executable, the return status is If a command fails because of an error during expansion or redirection, the exit status is greater than zero.

The exit status is used by the Bash conditional commands see Conditional Constructs and some of the list constructs see Lists. All of the Bash builtins return an exit status of zero if they succeed and a non-zero status on failure, so they may be used by the conditional and list constructs. All builtins return an exit status of 2 to indicate incorrect usage, generally invalid options or missing arguments.

Non-builtin commands started by Bash have signal handlers set to the values inherited by the shell from its parent. If Bash is waiting for a command to complete and receives a signal for which a trap has been set, the trap will not be executed until the command completes.

When Bash is waiting for an asynchronous command via the wait builtin, the reception of a signal for which a trap has been set will cause the wait builtin to return immediately with an exit status greater than , immediately after which the trap is executed.

A shell script is a text file containing shell commands. When such a file is used as the first non-option argument when invoking Bash, and neither the -c nor -s option is supplied see Invoking Bash , Bash reads and executes commands from the file, then exits.

This mode of operation creates a non-interactive shell. When Bash runs a shell script, it sets the special parameter 0 to the name of the file, rather than the name of the shell, and the positional parameters are set to the remaining arguments, if any are given.

If no additional arguments are supplied, the positional parameters are unset. A shell script may be made executable by using the chmod command to turn on the execute bit. In other words, executing. This subshell reinitializes itself, so that the effect is as if a new shell had been invoked to interpret the script, with the exception that the locations of commands remembered by the parent see the description of hash in Bourne Shell Builtins are retained by the child. Thus, you can specify Bash, awk , Perl, or some other interpreter and write the rest of the script file in that language.

The arguments to the interpreter consist of one or more optional arguments following the interpreter name on the first line of the script file, followed by the name of the script file, followed by the rest of the arguments supplied to the script. The details of how the interpreter line is split into an interpreter name and a set of arguments vary across systems. Bash will perform this action on operating systems that do not handle it themselves.

Bash scripts often begin with! Builtin commands are contained within the shell itself. When the name of a builtin command is used as the first word of a simple command see Simple Commands , the shell executes the command directly, without invoking another program. Builtin commands are necessary to implement functionality impossible or inconvenient to obtain with separate utilities.

This section briefly describes the builtins which Bash inherits from the Bourne Shell, as well as the builtin commands which are unique to or have been extended in Bash. Several builtin commands are described in other chapters: builtin commands which provide the Bash interface to the job control facilities see Job Control Builtins , the directory stack see Directory Stack Builtins , the command history see Bash History Builtins , and the programmable completion facilities see Programmable Completion Builtins.

The following shell builtin commands are inherited from the Bourne Shell. Do nothing beyond expanding arguments and performing redirections. The return status is zero. Read and execute commands from the filename argument in the current shell context. If filename does not contain a slash, the PATH variable is used to find filename.

If any arguments are supplied, they become the positional parameters when filename is executed. Otherwise the positional parameters are unchanged. The return status is the exit status of the last command executed, or zero if no commands are executed. If filename is not found, or cannot be read, the return status is non-zero.

This builtin is equivalent to source. Exit from a for , while , until , or select loop. If n is supplied, the n th enclosing loop is exited. The return status is zero unless n is not greater than or equal to 1. Change the current working directory to directory. If directory is not supplied, the value of the HOME shell variable is used. Any additional arguments following directory are ignored. If the -e option is supplied with -P and the current working directory cannot be successfully determined after a successful directory change, cd will return an unsuccessful status.

On systems that support it, the - option presents the extended attributes associated with a file as a directory. Resume the next iteration of an enclosing for , while , until , or select loop.

If n is supplied, the execution of the n th enclosing loop is resumed. The arguments are concatenated together into a single command, which is then read and executed, and its exit status returned as the exit status of eval.

If there are no arguments or only empty arguments, the return status is zero. If command is supplied, it replaces the shell without creating a new process. If the -l option is supplied, the shell places a dash at the beginning of the zeroth argument passed to command. This is what the login program does. The -c option causes command to be executed with an empty environment.

If -a is supplied, the shell passes name as the zeroth argument to command. If command cannot be executed for some reason, a non-interactive shell exits, unless the execfail shell option is enabled. In that case, it returns failure.

An interactive shell returns failure if the file cannot be executed. A subshell exits unconditionally if exec fails. If no command is specified, redirections may be used to affect the current shell environment. If there are no redirection errors, the return status is zero; otherwise the return status is non-zero.

If n is omitted, the exit status is that of the last command executed. Any trap on EXIT is executed before the shell terminates. Mark each name to be passed to child processes in the environment. If the -f option is supplied, the name s refer to shell functions; otherwise the names refer to shell variables. The -n option means to no longer mark each name for export. If no names are supplied, or if the -p option is given, a list of names of all exported variables is displayed.

The -p option displays output in a form that may be reused as input. The return status is zero unless an invalid option is supplied, one of the names is not a valid shell variable name, or -f is supplied with a name that is not a shell function. Each time it is invoked, getopts places the next option in the shell variable name , initializing name if it does not exist, and the index of the next argument to be processed into the variable OPTIND.

The shell does not reset OPTIND automatically; it must be manually reset between multiple calls to getopts within the same shell invocation if a new set of parameters is to be used.

When the end of options is encountered, getopts exits with a return value greater than zero. If the first character of optstring is a colon, silent error reporting is used. In normal operation, diagnostic messages are printed when invalid options or missing option arguments are encountered. If the variable OPTERR is set to 0, no error messages will be displayed, even if the first character of optstring is not a colon.

Each time hash is invoked, it remembers the full pathnames of the commands specified as name arguments, so they need not be searched for on subsequent invocations. Any previously-remembered pathname is discarded.

The -p option inhibits the path search, and filename is used as the location of name. The -r option causes the shell to forget all remembered locations.

The -d option causes the shell to forget the remembered location of each name. If the -t option is supplied, the full pathname to which each name corresponds is printed.

If multiple name arguments are supplied with -t , the name is printed before the hashed full pathname. The -l option causes output to be displayed in a format that may be reused as input. If no arguments are given, or if only -l is supplied, information about remembered commands is printed. The return status is zero unless a name is not found or an invalid option is supplied. Print the absolute pathname of the current working directory. If the -P option is supplied, the pathname printed will not contain symbolic links.

If the -L option is supplied, the pathname printed may contain symbolic links. The return status is zero unless an error is encountered while determining the name of the current directory or an invalid option is supplied. Mark each name as readonly. The values of these names may not be changed by subsequent assignment. If the -f option is supplied, each name refers to a shell function. The -a option means each name refers to an indexed array variable; the -A option means each name refers to an associative array variable.

If both options are supplied, -A takes precedence. If no name arguments are given, or if the -p option is supplied, a list of all readonly names is printed. The other options may be used to restrict the output to a subset of the set of readonly names. The -p option causes output to be displayed in a format that may be reused as input. The return status is zero unless an invalid option is supplied, one of the name arguments is not a valid shell variable or function name, or the -f option is supplied with a name that is not a shell function.

Cause a shell function to stop executing and return the value n to its caller. If n is not supplied, the return value is the exit status of the last command executed in the function. If return is executed by a trap handler, the last command used to determine the status is the last command executed before the trap handler.

If return is executed during a DEBUG trap, the last command used to determine the status is the last command executed by the trap handler before return was invoked. If n is supplied, the return value is its least significant 8 bits.

The return status is non-zero if return is supplied a non-numeric argument or is used outside a function and not during the execution of a script by. Shift the positional parameters to the left by n. If n is not supplied, it is assumed to be 1. Evaluate a conditional expression expr and return a status of 0 true or 1 false. Each operator and operand must be a separate argument. Expressions may be combined using the following operators, listed in decreasing order of precedence.

The evaluation depends on the number of arguments; see below. Operator precedence is used when there are five or more arguments. Returns the value of expr. The test and [ builtins evaluate conditional expressions using a set of rules based on the number of arguments. If the first argument is one of the unary conditional operators see Bash Conditional Expressions , the expression is true if the unary test is true.

If the first argument is not a valid unary operator, the expression is false. Otherwise, the expression is parsed and evaluated according to precedence using the rules listed above. Print out the user and system times used by the shell and its children. The commands in arg are to be read and executed when the shell receives signal sigspec. If arg is the null string, then the signal specified by each sigspec is ignored by the shell and commands it invokes.

If arg is not present and -p has been supplied, the shell displays the trap commands associated with each sigspec. If no arguments are supplied, or only -p is given, trap prints the list of commands associated with each signal number in a form that may be reused as shell input. The -l option causes the shell to print a list of signal names and their corresponding numbers. Each sigspec is either a signal name or a signal number.

Signal names are case insensitive and the SIG prefix is optional. If a sigspec is 0 or EXIT , arg is executed when the shell exits. If a sigspec is DEBUG , the command arg is executed before every simple command, for command, case command, select command, every arithmetic for command, and before the first command executes in a shell function.

If a sigspec is ERR , the command arg is executed whenever a pipeline which may consist of a single simple command , a list, or a compound command returns a non-zero exit status, subject to the following conditions.

These are the same conditions obeyed by the errexit -e option. Signals ignored upon entry to the shell cannot be trapped or reset. Trapped signals that are not being ignored are reset to their original values in a subshell or subshell environment when one is created. If mode begins with a digit, it is interpreted as an octal number; if not, it is interpreted as a symbolic mode mask similar to that accepted by the chmod command.

If mode is omitted, the current value of the mask is printed. If the -S option is supplied without a mode argument, the mask is printed in a symbolic format. If the -p option is supplied, and mode is omitted, the output is in a form that may be reused as input. The return status is zero if the mode is successfully changed or if no mode argument is supplied, and non-zero otherwise.

Note that when the mode is interpreted as an octal number, each number of the umask is subtracted from 7. Thus, a umask of results in permissions of Remove each variable or function name. If the -v option is given, each name refers to a shell variable and that variable is removed. If the -f option is given, the name s refer to shell functions, and the function definition is removed. If the -n option is supplied, and name is a variable with the nameref attribute, name will be unset rather than the variable it references.

If no options are supplied, each name refers to a variable; if there is no variable by that name, a function with that name, if any, is unset. Readonly variables and functions may not be unset. Some shell variables lose their special behavior if they are unset; such behavior is noted in the description of the individual variables.

The return status is zero unless a name is readonly. This section describes builtin commands which are unique to or have been extended in Bash. Without arguments or with the -p option, alias prints the list of aliases on the standard output in a form that allows them to be reused as input.

If arguments are supplied, an alias is defined for each name whose value is given. If no value is given, the name and value of the alias is printed. Aliases are described in Aliases. Display current Readline see Command Line Editing key and function bindings, bind a key sequence to a Readline function or macro, or set a Readline variable.

Each non-option argument is a command as it would appear in a Readline initialization file see Readline Init File , but each binding or command must be passed as a separate argument; e. Use keymap as the keymap to be affected by the subsequent bindings. Acceptable keymap names are emacs , emacs-standard , emacs-meta , emacs-ctlx , vi , vi-move , vi-command , and vi-insert.

Display Readline function names and bindings in such a way that they can be used as input or in a Readline initialization file. Display Readline variable names and values in such a way that they can be used as input or in a Readline initialization file.

Display Readline key sequences bound to macros and the strings they output in such a way that they can be used as input or in a Readline initialization file. Cause shell-command to be executed whenever keyseq is entered. List all key sequences bound to shell commands and the associated commands in a format that can be reused as input. Run a shell builtin, passing it args , and return its exit status.

This is useful when defining a shell function with the same name as a shell builtin, retaining the functionality of the builtin within the function. The return status is non-zero if shell-builtin is not a shell builtin command. Returns the context of any active subroutine call a shell function or a script executed with the. Without expr , caller displays the line number and source filename of the current subroutine call. If a non-negative integer is supplied as expr , caller displays the line number, subroutine name, and source file corresponding to that position in the current execution call stack.

This extra information may be used, for example, to print a stack trace. The current frame is frame 0. The return value is 0 unless the shell is not executing a subroutine call or expr does not correspond to a valid position in the call stack. Runs command with arguments ignoring any shell function named command.

Only shell builtin commands or commands found by searching the PATH are executed. The -p option means to use a default value for PATH that is guaranteed to find all of the standard utilities.

The return status in this case is if command cannot be found or an error occurred, and the exit status of command otherwise. If either the -V or -v option is supplied, a description of command is printed. The -v option causes a single word indicating the command or file name used to invoke command to be displayed; the -V option produces a more verbose description.

In this case, the return status is zero if command is found, and non-zero if not. Declare variables and give them attributes. If no name s are given, then display the values of variables instead. The -p option will display the attributes and values of each name. When -p is used with name arguments, additional options, other than -f and -F , are ignored. When -p is supplied without name arguments, declare will display the attributes and values of all variables having the attributes specified by the additional options.

If no other options are supplied with -p , declare will display the attributes and values of all shell variables. The -f option will restrict the display to shell functions. The -F option inhibits the display of function definitions; only the function name and attributes are printed.

If the extdebug shell option is enabled using shopt see The Shopt Builtin , the source file name and line number where each name is defined are displayed as well. The -g option forces variables to be created or modified at the global scope, even when declare is executed in a shell function. It is ignored in all other cases. The -I option causes local variables to inherit the attributes except the nameref attribute and value of any existing variable with the same name at a surrounding scope.

If there is no existing variable, the local variable is initially unset. The following options can be used to restrict output to variables with the specified attributes or to give variables attributes:.

The variable is to be treated as an integer; arithmetic evaluation see Shell Arithmetic is performed when the variable is assigned a value. When the variable is assigned a value, all upper-case characters are converted to lower-case. The upper-case attribute is disabled. Give each name the nameref attribute, making it a name reference to another variable. That other variable is defined by the value of name. The nameref attribute cannot be applied to array variables.

Make name s readonly. These names cannot then be assigned values by subsequent assignment statements or unset.

Give each name the trace attribute. The trace attribute has no special meaning for variables. When the variable is assigned a value, all lower-case characters are converted to upper-case.

The lower-case attribute is disabled. When used in a function, declare makes each name local, as with the local command, unless the -g option is used. When using -a or -A and the compound assignment syntax to create array variables, additional attributes do not take effect until subsequent assignments. Output the arg s, separated by spaces, terminated with a newline.

The return status is 0 unless a write error occurs. If -n is specified, the trailing newline is suppressed. If the -e option is given, interpretation of the following backslash-escaped characters is enabled.

The -E option disables the interpretation of these escape characters, even on systems where they are interpreted by default. Quantity: 1. Product Details. There are several objectives of the Laboratory Interpretation Reference Manual:.

Provide insights into the functional state rather than just the pathological condition. However, it is useful to understand the endpoint pathology in the spectrum of health versus disease.

Explore the integrated physiology that explains blood values. Foster an approach that addresses fundamental issues using objective measurements as guideposts.

Functional medicine is a not a set of facts to consider but is rather a process of understanding structure and physiology. Optimal biochemistry leads to metabolic, hormonal, immunologic, endocrine, and autonomic balance and increased vital reserves.

All of this leads to an increased and adaptive capacity. Healthier Patients. Corporate Brochure. Interested in a career at an Award-winning Company? View Open Positions. Get More Patients with Mailing Services. Practices that are generally recommended by SCPP as part of providing quality pharmacy care.

Members are encouraged to follow these recommended courses of action. A member must exercise reasonable discretion and have justifiable reasons when there is a decision to NOT follow a guideline.



0コメント

  • 1000 / 1000