Man sh

xiaoxiao2021-03-06  41

User Commands SH (1)

Name SH, JSH - Standard and Job Control Shell and Command Inter - PRETER

Synopsis / usr / bin / sh [-cefhiknprstuvx] [argument ...]

/ usr / xpg4 / bin / sh [ abcefhikmnoprstuvx] [ o option ...] [-c string] [arg ...]

/ usr / bin / jsh [-cefhiknprstuvx] [argument ...]

Description the / usr / bin / sh utility is a commnd programming language That Executes Commands Read from a Terminal OR A file.

The / usr / xpg4 / bin / sh utility is identical to / usr / bin / ksh. See Ksh (1).

The JSH Utility Is An Interface To The Shell That Provides All of The FunctionAry OF SH AND Enables Job Control (See Job Control Section Below).

Arguments to the shell area listed in the invocation section.

Definitions a blank is a tab OR A Space. A name is a sequence of ascii letters, digits, or understandscores, beginning with a letter or an name, a digit, or any of the characters *, @, #,?, -, $, and!.

USAGE Commands A simple-command is a sequence of non-blank words separated by blanks. The first word specifies the name of the command to be executed. Except as specified below, the remaining words are passed as arguments to the invoked command. The command Name IS Passed as Argument 0 (See Exec (2)). The value of a simmand is its exit status if it Ter- minates Normal, or (Octal) 200 Status if it Terminates Abnormal; Signal (3Head) for A List of status values.

A pipeline is a sequence of one or more commands separated by | The standard output of each command but the last is connected by a pipe (2) to the standard input of the next command Each command is run as a separate process;. The. SHELL WAITS for THE Last To Terminate. The EXIT STATUS OF A PIPELINE IS The EXIT STATUS OF THE LAST IS THE PIPELINE.A List is a separated by; &, &&, or ||, and optionally terminated by; or & of these four symbols,;. and & have equal precedence, which is lower than that of && and || The symbols && and || also have equal precedence A semicolon.. (;) causes sequential execution of the preceding pipeline (that is, the shell waits for the pipeline to finish before executing any com- mands following the semicolon); an ampersand (&) causes asynchronous execution of the preceding pipeline (that is, the shel l does not wait for that pipeline to finish). The symbol && (||) causes the list following it to be executed only if the preceding pipeline returns a zero (non-zero) exit status. An arbitrary number of newlines may appear in A list, instead of semicolons, to delimit commands.

.

For Name [in Word ...] do list done each time a for command is execute list once for each positional parameter that is set (see Parameter Substitution section below). Execution ends when there are no more words in the list.command executes the list associated with the first pattern thatmatches word. The form of the patterns is the same as That Usedfor File-Name Generation (See File Name Generation) Except That A Slash, a Leading Dot, OR A Dot IMMEDITELY FOLLOW-ING A SLASH NEED NOTBE MATCHED EXPLICITLY. Case Word In [Pattern [Pattern]) list ;; ] ... ESAC A Case

IF list; "[elster;] FI

The list following if is executed and, if it returns a zero exit status, the list following the first then is executed. Otherwise, the list following elif is executed and, if its value is zero, the list following the next then is EXECUTED. FAILING THATED. IF No else list or death list is executed, The ing commnd returns a zero exit status.

while list do list done A while command repeatedly executes the while list and, if the exit status of the last command in the list is zero, executes the do list;. otherwise the loop terminates If no commands in the do list are executed, then ......................... ..

{List;} list is, parent) shell. The {must be followed by a space.

name () {list;} Define a function which is referenced by name The body of the function is the list of commands between {and} The {must be followed by a space Execution of functions is described below (see Execution sec... - TI {and} Are Unnecessary if the body of the function is a commnd as defined Above, Under COM- MANDS.

The Following Words Are ONLY Recognized As The First Word of A Command and when NOT quote:

IF THEN ELSE Elif Fi Case Esac for While Until Do Done {}

Comments Lines a Word Beginning with # causes That Word and All The Follow- ing characters up to a newline to be ignored.

Command Substitution The shell reads commands from the string between two grave accents ( ``) and the standard output from these commands may be used as all or part of a word. Trailing newlines from the standard output are removed.

No interpretation is done on the string before the string is read, except to remove backslashes (/) used to escape other characters. Backslashes may be used to escape a grave accent ( `) or another backslash (/) and are removed before the com - Mand String is read. Escaping grave accents allows Nested Command Substitution. If The Command Substitution LIES WISIN A Pair of Double Quotes ("...` ... `..."), a backslash used to escape a double quote / ") will be removed; otherwise, it will be left intact.If a backslash is used to escape a newline character (/ newline), both the backslash and the newline are removed (see the later section on Quoting) In. addition, backslashes used to escape dollar signs (/ $) are removed. Since no parameter substitution is done on the command string before it is read, inserting a backslash to escape a dollar sign has no effect. Backslashes that precede characters oth Er Than /, `,", Newline, And $ Are Left Intact When the Command String is Read.

Parameter Substitution The character $ is used to introduce substitutable parameters. There are two types of parameters, positional and key- word. If parameter is a digit, it is a positional parameter. Positional parameters may be assigned values ​​by set. Keyword parameters (Also Known As Variables) May Be Assigned Values ​​by Writing:

Name = value [name = value] ...

.

$ {Parameter} The value, if any, of the parameter is substituted. The braces are required only when parameter is fol- lowed by a letter, digit, or underscore that is not to be interpreted as part of its name. If parameter is * or @, all the positional parameters, starting with $ 1, are substituted (separated by spaces) Parameter $ 0 is set from argument zero when the shell is invoked $ {parameter: -word}.. If parameter is set and is non-null , Substitution ITS Value; OtherWise Substitute Word.

$ {parameter: = word} if parameter is notet; the value of the parameter is subs on be. positional parameters may not be assigned in this way.

$ {parameter:? word} if parameter is set and is non-null, substitude its value; orthol, print word and exit from the shell. if word is omitted, the message "parameter null or not set" isprinted.

$ {Parameter: Word} if parameter is set and is non-null, subs stortute word; Otherwise Substute Nothing.

In The Above, Word Is Not Evaluated Unless String, So That, In The Following Exam - Ple, PWD IS Executed Only D is Not Set or Is Null:

Echo $ {d: -`pwd`}

If the colon (:) is omitted from the Above expression, the shell only checks WHether Parameter is set or not.

The Following Parameters are Automatically Set by the shell.

# The Number of Positional Parameters in Decimal.

- Flags support to the shell on invocation or by the set command.

The Decimal Value Returned by The Last Synchronously Executed Command. $ The Process Number of this Shell.

! The process Number of the last background command invoked.

The Following Parameters Are Used by The Shell. The Parame- Ters in This Section Are Also Referred To As Environment Variables.

Home the default argument (Home Directory) for the cd com- mand, set to the user's login directory by login (1) from the password file (See Passwd (4)).

Path The Search Path for Commands (See Execution Section Below).

CDPath The Search path for the cd commernd.

Mail if this parameter is set to the name of a mail file and the mailpath parameter is not set, The shell inform The user of the arrival of mail in the speci- fied file.

MAILCHECK This parameter specifies how often (in seconds) the shell will check for the arrival of mail in the files specified by the MAILPATH or MAIL parameters. The default value is 600 seconds (10 minutes). If set to 0, the shell will check Before Each Prompt.

MAILPATH A colon (:) separated list of file names. If this parameter is set, the shell informs the user of the arrival of mail in any of the specified files. Each file name can be followed by% and a message that will be printed When the model time change. The default message is, you have mail.

Ps1 primary prompt string, by default "$".

PS2 Secondary Prompt String, by default ">".

IFS Internal field separators, normally space, tab, and newline (see Blank Interpretation section) .SHACCT If this parameter is set to the name of a file writ- able by the user, the shell will write an accounting record in the file for each Shell Procedure Executed.

SHELL WHEN THELL IS INVOKED, IT Scans The Environment (See Environment Section Below for this name.

See ENVIRON (5) for Descriptions of The Following Environment Variables That Affect The Execution of SH: LC_CTYPE AND LC_MESSAGES.

The Shell Gives Default Values ​​To Path, PS1, PS2, Mailcheck, And IFS. Home And Mail Are Set By login (1).

Blank Interpretation After parameter and command substitution, the results of substitution are scanned for internal field separator characters (those found in IFS) and split into distinct argu- ments where such characters are found. Explicit null argu- ments ( "" or ' ') Are Retained. Implicit Null Arguments (Those Resulting from Parameters That Have No Values) Are removed.

Input / Output Redirection A command's input and output may be redirected using a spe- cial notation interpreted by the shell. The following may appear anywhere in a simple-command or may precede or follow a command and are not passed on as arguments to the invoked Command. Note: Parameter and Command Substitution Occurs Before Word OR Digit is used.

.> Word Use file word as standard output (file descriptor 1) If the file does not exist, it is created; otherwise, it is truncated to zero length >> word Use file word as standard output If the file exists, output.. IS appended to it (by first seeking to the eof); OtherWise, The File is created.

<> Word Open File Word for Reading and Writing As Standard Input.

<< [-] Word After Parameter And Command Substitution IS DONE ON WORD, The Shell Input is Read Up to the resulting word, or to an an estil, however, - is appended to <<:

1) Leading Tabs Are Stripped from Word Before The Shell INPUT IS Read (But After Parameter and Command Substi- Tution IS DONE ON WORD),

2) Leading Tabs Are Stripped from The Shell Input As IT IT and BEFORE Each Line IS Compared with Word, And

3) Shell INPUT IS Read Up to The First Line That Litrally Matches The Resulting Word, or To an EOF.

IF Any Character of Word Is Quoted (See Quoting Section Later), No Additional Processing Is Done to The Shell Input. If No Characters of Word Are Quoted:

1) Parameter and Command Substitution Occurs,

2) (escaped) / newlines are removed, And

3) / Must be used to quote the characters /, $, and `.

The resulting document Becomes The Standard INPUT.

<& Digit Use The File Associated with File Descriptor Digit AS Standard Input. Similarly For The Standard Output Using> & Digit.

<& - The standard input is closed Similarly for the standard output using.> & -. If any of the above is preceded by a digit, the file descriptor which will be associated with the file is that specified by the digit (instead Of the default 0 or 1). for example:

... 2> & 1

Associates File Descriptor 2 with The File Currently Associ- ATED with file descriptor 1.

The Order In Which Redirections Are Specified Is Signifi- Cant. The Shell Evaluates Redirections Left-To-Right. For Example:

... 1> xxx 2> & 1

first associates file descriptor 1 with file xxx. It associates file descriptor 2 with the file associated with file descriptor 1 (that is, xxx). If the order of redirections were reversed, file descriptor 2 would be associated with the terminal (assuming File Descriptor 1 Had Been) And File Descriptor 1 Would Be Associated with file xxx.

Using the terminology introduced on the first page, under Commands, if a command is composed of several simple com- mands, redirection will be evaluated for the entire command before it is evaluated for each simple command. That is, the shell evaluates redirection for the .

If a command is followed by & the default standard input for the command is the empty file / dev / null. Otherwise, the environment for the execution of a command contains the file descriptors of the invoking shell as modified by input / output specifications.

File Name Generation Before a command is executed, each command word is scanned for the characters *,?, And [. If one of these characters appears the word is regarded as a pattern. The word is replaced with alphabetically sorted file names that match the pattern. If no file name is found that matches the pattern, the word is left unchanged. The character. at the start of a file name or immediately following a /, as well as the character / itself, must be matched explicitly. * Matches Any String, Including the Null String.

Matches Any Single Character.

[...] Matches any one of the enclosed characters A pair of characters separated by -.. Matches any character lexi- cally between the pair, inclusive If the first character following the opening [is a, any character not enclosed! IS matched.

Note That All Quoted Characters (See Below) Must Be Matched Explicitly in A FileName.

Quoting the folowing to the shell and cause termination of a word unless quoted:

; & () | ^ <> Newline space Tab

A character may be quoted (that is, made to stand for itself) by preceding it with a backslash (/) or inserting it between a pair of quote marks ( '' or ""). During processing, the shell may quote certain characters to prevent them from taking on a special meaning. Backslashes used to quote a single character are removed from the word before the command is executed. The pair / newline is removed from a word before command and parameter substitution.

All characters enclosed between a pair of single quote marks ( ''), except a single quote, are quoted by the shell. Backslash has no special meaning inside a pair of single quotes. A single quote may be quoted inside a pair of double quote Marks (for Example, "'"), But a single quote can not be quotes.inside a pair of single quotes.inside a pair of double quote marks (""), parameter and com- mand subsstitution Occurs and the shell quotes the results . to avoid blank interpretation and file name generation If $ * is within a pair of double quotes, the positional parameters are substituted and quoted, separated by quoted spaces ( "$ 1 $ 2 ..."); however, if $ @ is within a PAIR OF Double Quotes, The Positional Parameters Are SubstitudeD and quoted, Separated by UNQUOTED SPACES ("$ 1" $ 2 "...). / quotes the character parameter and Command substitude. if A Backslash Precedes Characters Other Than /, `

Prompting When used interactively, the shell prompts with the value of PS1 before reading a command. If at any time a newline is typed and further input is needed to complete a command, the secondary prompt (that is, the value of PS2) is issued .

Environment The environment (see environ (5)) is a list of name-value pairs that is passed to an executed program in the same way as a normal argument list. The shell interacts with the environment in several ways. On invocation, the shell scans the environment and creates a parameter for each name found, giving it the corresponding value. If the user modifies the value of any of these parameters or creates new parameters, none of these affects the environment unless the export com- mand is used to bind the shell's parameter to the environment (see also set -a). A parameter may be removed from the environment with the unset command. The environment seen by any executed command is thus composed of any unmodi- fied name-value pairs originally inherited by the Shell, Minus Any Pairs Removed by Unset, Plus Any Modifications or Additions, All of Which Must Be Nonded in Export Commands.The Environment F OR ANY Simple-Command May Be Augment by Prefixing It With One or More Assignments To Parameters. thus:

Term = 450 Command

and

(Export Term; Term = 450; Command)

Are Equivalent As Far As The Execution of Command Is Con- CERNED IF COMMAND IS NOT A Special Command. IF Command IS A Special Command, THEN

Term = 450 Command

Will Modify The Term Variable in The Current Shell.

IF The --k flag is set, All Keyword Arguments Are Placed in The Environment, Even I Occur After The Comming Name. The Following Example First Prints A = B C and C:

Echo a = b c

A = B C

Set -k

Echo a = b c

c

Signals The INTERRUPT and QUIT signals for an invoked command are ignored if the command is followed by &; otherwise signals have the values ​​inherited by the shell from its parent, with the exception of signal 11 (but see also the trap command below) .Execution each time a command is executed, the command substitution, parameter substitution, blank interpretation, input / output redirection, and filename generation listed above are car- ried out. If the command name matches the name of a defined function, the function is executed in the shell process (note how this differs from the execution of shell script files, which require a sub-shell for invocation). If the command name does not match the name of a defined function, but matches one of the Special Commands listed below, It is executed in the shell process.

The positional parameters $ 1, $ 2, ... are set to the argu- ments of the function. If the command name matches neither a Special Command nor the name of a defined function, a new process is created and an attempt is made to execute The Command Via EXEC (2).

The shell parameter PATH defines the search path for the directory containing the command. Alternative directory names are separated by a colon (:). The default path is / usr / bin. The current directory is specified by a null path name, which can appear immediately after the equal sign, between two colon delimiters anywhere in the path list, or at the end of the path list. If the command name contains a / the search path is not used. Otherwise, each directory in the path is searched for an executable file. If the file has execute permission but is not an a.out file, it is assumed to be a file containing shell commands. A sub-shell is spawned to read it. A parenthesized command is also executed in a sub-shell .The location in the search path where a command was found IS kill (1)). The shell (to help avoid unnecessary exec "

Login [argument ...] Equivalent to `Exec login argument .... 'See login (1) for usage and description.

Newgrp [argument] Equivalent to exec network. See newgrp (1) for usage and description.

PWD Print The Current Working Directory. See PWD (1) for usage and description.

read name ... One line is read from the standard input and, using the internal field separator, IFS (normally space or tab), to delimit word boundaries, the first word is assigned to the first name, the second word to the second name, and so forth, with leftover words assigned to the last name. Lines can be continued using / newline. Characters other than newline can be quoted by preceding them with a backslash. These backslashes are removed before words are assigned to names, and no interpretation is done on the character that follows the backslash. The return code is 0, unless an EOF is encountered.readonly [name ...] The given names are marked readonly and the values ​​of the these names may not be changed by subsequent assignment . If NO arguments Are Given, A List of All Reado Nly Names is printed.

Return [N] Causes a function to exit with the return value speci- Fied by n. if n is omitted, the return status is there below the last command execute.

Set [-aefhkntuvx [argument ...]]

-a Mark Variables Which Are Modified or create for export.

- EXIT IMMEDIATELY IF A Command EXITS WITH A NON-ZERO EXIT STATUS.

-f disable file name generation.

-h Locate and Remember Function Commands As Functions Are Defined (Function Commands Are Normal Located When the Function is Executed).

--k All Keyword Arguments Are Placed In The Environment For A Command, NOT JUST Those That Precede The Command name.-N Read Commands But do Not Execute Them.

-t exit after reading and executing one command.

-u Treat unset variables as an error when substitude.

-v print shell input lines as They isy.

-x print commands and their arguments as the is is the is- creted.

- Do Not Change Any of the flags; useful in setting $ 1 to -.

Using rather than -. Causes these flags to be turned off These flags can also be used upon invocation of the shell The current set of flags may be found in $ -.. The remaining arguments are positional parameters and are assigned, in order, To $ 1, $ 2, ... if No Arguments Are Given The Values ​​of All Names Are Printed.

Shift [N] The Positional Parameters from $ N 1 ... Are Renamed $ 1 .... if n is not given, IT is assoced to be 1.

STOP PID ... HALT EXECUTION OF THE Process Number PID. (See PS (1)).

Suspend stops The Execution of The Current Shell (But not if it is the login shell).

Test Evaluate Conditional Expressions. See test (1) for usage and description.

Times Print The Accumulate User and System Times for Processes Run from the shell.

Trap [Argument N [N2 ...]]] The command argument is to beread and executed when shell receivers Numeric or Symbolic Signal (s) (N). (N). (N). (N). (N). (N) (N). (N) (N). the trap is taken.) Trap commands are executed in order of signal number or corresponding symbolic names. Any attempt to set a trap on a signal that was ignored on entry to the current shell is ineffective. An attempt to trap on signal 11 (memory fault) produces an error. If argument is absent all trap (s) n are reset to their original values. If argument is the null string this signal is ignored by the shell and by the commands it invokes. If n is 0 the Command Argument is Executed on Exit from the shell. The trap command with no arguments prints a list of commists associated with each signal number number.type Name ...] for Each Name, Indicate How It Would Be Interpreted If Used As a Command Name.

ULIMIT [- [HS] [A | CDFNSTV]]

Ulimit [- [HS] [C | D | f | n | s | t | v]] Limit Ulimit Prints or Sets Hard or Soft Resource Limits. There Limits Are Described in Gtrlimit (2).

IF Limit Is Not Present, Ulimit Prints The Specified Limits. Any Number of Limits May Be Print At One Time. The -a Option Prints All Limits.

If limit is present, ulimit sets the specified limit to limit. The string unlimited requests the largest valid limit. Limits may be set for only one resource at a time. Any user may set a soft limit to any value below the hard limit. Any User May Lower a Hard Limit. Only A Super-User May Raise a Hard Limit; See Su (1M) .The -h Option Specifies a Hard Limit. The -s Option Specifies A Soft Limit. if Neither Option IS Speci- Fied, ULIMIT WILL SET Both Limits and Print The Soft Limit.

The Following Options Specify The Resource Whose Lim- ITS Are To Be Print OR Set. If No Option IS Speci- Fied, The File Size Limit Is Printed Or Set.

-c Maximum Core File Size (in 512-Byte Blocks)

-d Maximum Size of Data Segment Or Heap (in Kbytes)

-f Maximum File Size (in 512-byte blocks)

-n Maximum File Descriptor Plus 1

-s Maximum size of stack segment (in kbytes)

-T Maximum CPU Time (In Seconds)

-v Maximum Size of Virtual Memory (in kbytes)

Run the sysdef (1M) command to obtain the maximum pos- sible limits for your system. The values ​​reported are in hexadecimal, but can be translated into decimal numbers using the bc (1) utility. See swap (1M).)

Example of Ulimit: To Limit The Size of a Core File Dump To 0 mega- bytes, Type the Following:

Ulimit -c 0

UMASK [NNN] The user file-creation mask is set to nnn (see umask (1)). IF nnn is omitted, The Current Value of the mask isprinted.

unset [name ...] For each name, remove the corresponding variable or function value. The variables PATH, PS1, PS2, MAIL- CHECK, and IFS can not be unset.wait [n] Wait for your background process whose process id is N and report ITS Termination status. if n is omitted, all your shell's currently active background processes area waited for and the return code will will be zero.

Invocation If the shell is invoked through exec (2) and the first char- acter of argument zero is -, commands are initially read from / etc / profile and from $ HOME / .profile, if such files exist Thereafter, commands are read. As Described Below, Which Is Also The Case When The Shell Is Invoked AS / USR / BIN / Sh. The flag. Note: Unless The --c or -s flag is speci- fied, the First Argument is associning commands, and the remaining arguments area passed as positional parameters to That Command file:

-c string if the -c flag is presentss area read from string.

-i If the -i flag is present or if the shell input and output are attached to a terminal, this shell is interactive. In this case TERMINATE is ignored (so that kill 0 does not kill an interactive shell) and INTERRUPT is caught and Ignored (So That Wait Is Interruptible). in all caves qit is ignored by the shell.

-p if the -p flag is present ).

-s If the -s flag is present or if no arguments remain, commands are read from the standard input. Any remain- ing arguments specify the positional parameters. Shell output (except for Special Commands) is written to file descriptor 2.

The Remaining Flags and Arguments Are Described Under The Set Command ABOVE.

Job Control (jsh) When the shell is invoked as jsh, Job Control is enabled in addition to all of the functionality described previously for sh. Typically Job Control is enabled for the interactive shell only. Non-interactive shells typically do not benefit from the Added FunctionAlicity of Job Control.

With Job Control enabled every command or pipeline the user enters at the terminal is called a job All jobs exist in one of the following states:.. Foreground, background or stopped These terms are defined as follows: 1) a job in the foreground has read and write access to the controlling terminal; 2) a job in the background is denied read access and has conditional write access to the controlling terminal (see stty (1)); 3) a stopped job is a job that has been placed in a suspended state, usually as a result of a size, Signal (See Signal (3Head)).

Every job that the shell starts is assigned a positive integer, called a job number which is tracked by the shell and will be used as an identifier to indicate a specific job. Additionally the shell keeps track of the current and previous jobs. The current job Is The Most Recent Job To Be Started Or Restarted. The Previous Job Is The First Non- Current Job.The Acceptable Syntax for a Job Identifier IS of The Form:

% JobID

WHERE, Jobid May Be Specified in Any of The Following for- Mats:

% or for the current job

- for the previous job

Specify The Job for Which The Command Line Unique Contains String.

N for Job Number N, Where N Is A Job Number

pref where pref is a unique prefix of the command name (for example, if the command ls -l name were running in the background, it could be referred to as% ls); pref can- not contain blanks unless it is quoted.

When Job Control Is Enabled, The Following Commands Areadded To The User's Environment To Manipulate Jobs:

BG [% Jobid ...] Resumes the Execution of a stopped job in the back- ground. if% jobid is omitted the current job is associx.

FG [% Jobid ...] Resumes the Execution of a stopped Job in the fore-, also moves an executing background. If% jobid is omitted the credent job is associx.

Jobs [-p | -l] [% jobid ...]

jobs -x command [arguments] Reports all jobs that are stopped or executing in the background. If% jobid is omitted, all jobs that are stopped or running in the background will be reported. The following options will modify / enhance the output of jobs : -l Report The Process Group ID and Working Direc- Tory of The Jobs.

-p Report Only The Process Group ID of The Jobs.

-x replace Any Jobid Found In Command or Arguments with The Corresponding Process Group ID, And The Execute Command Passing It Arguments.

Kill [-Signal]% Jobid Builtin Version of Kill To Provide The FunctionAry of the Kill Command for Processes Identified With A JobID.

Stop% Jobid ... Stops the Execution of A Background Job (s).

Suspend stops The Execution of The Current Shell (But not if it is the login shell).

Wait [% Jobid ...] Wait Builtin Accepts a Job Identifier. IF% Jobid IS OMITTED WAIT BEHAVES AS Described Above Under Special Commands.

Large File Behavior See Largefile (5) for the description of the Behavior of Sh and Jsh When Encountering Files Greater Than or Equal To 2 Gbyte (2 ** 31 bytes).

EXIT STATUS Errors detected by the shell, such as syntax errors, cause the shell to return a non-zero exit status. If the shell is being used non-interactively execution of the shell file is abandoned. Otherwise, the shell returns the exit status Of The last command Executed (See Also The EXIT COMMAND ABOVE).

JELL ISUES ONE WARNING: The Shell Issues ONE WARNING.

.................... ..

Files $ homen / .profile

/ dev / null

/ etc / profile

/ TMP / Sh *

Attributes See Attributes (5) for descriptions of the folload attri- butes:

/ Usr / bin / sh / usr / bin / jsh ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | | Availability | SUNWcsu | | CSI | Enabled | | _____________________________ | _____________________________ |

/ Usr / xpg4 / bin / sh ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | | Availability | SUNWxcu4 | | CSI | Enabled | | _____________________________ | _____________________________ |

See Also Intro (1), BC (1), Echo (1), Getoptcvt (1), Kill (1), KSH (1), Login (1), NewGRP (1), PS (1), PWD (1 ), Shell_builtins (1), stty (1), Test (1), umask (1), Wait (1), RSH (1M), Su (1M), SWAP (1M), SYSDEF (1M), DUP (2 ), EXEC (2), fork (2), getrlimit (2), pipe (2), ulimit (2), setlocale (3c), Passwd (4), Profile (4), Attributes (5), Environ (5 ), Largefile (5), Signal (3Head), XPG4 (5)

Warnings The Use of setuid shell scripts is strongly discouraged.

NOTES Words used for filenames in input / output redirection are not interpreted for filename generation (see File Name Generation section above). For example, cat file1> a * will create a file named a * .Because commands in pipelines are run as separate processes Variables set in a pipeline has no effect on the parent shell.

If you get the error message can not fork, too many processes, try using the wait (1) command to clean up your background processes. If this does not help, the system process table is probably full or you have too many active foreground processes . (There is a limit to the number of process ids associated with your login, and to the number the system can keep track of.)

Only the last process in a pipeline can be waited.

If a command is executed, and a command with the same name is installed in a directory in the search path before the directory where the original command was found, the shell will continue to exec the original command. Use the hash command to correct this situation .

The Bourne Shell Has A Limitation on The Effective Uid a Process. IF this uid is less 100 (and not equal to the process "real uid), The Uid is Reset To The Process' Real Uid.

Because the shell implements both foreground and background jobs in the same process group, they all receive the same signals, which can lead to unexpected behavior. It is, therefore, recommended that other job contrl shells be used, especially in an interactive environment.

When the shell executes a shell script that attempts to exe- cute a non-existent command interpreter, the shell returns an erroneous diagnostic message that the shell script file does not exist.SunOS 5.8 Last change: 9 May 1997 22

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

New Post(0)