Linux "sh" Command Line Options and Examples
command interpreter

dash is the standard command interpreter for the system. The current version of dash is in the process of being changed to conform with the POSIX 1003.2 and 1003.


Usage:

dash [-aCefnuvxIimqVEbp] [+aCefnuvxIimqVEbp] [-o option_name] [+o option_name] [command_file [argument ...]]
dash -c [-aCefnuvxIimqVEbp] [+aCefnuvxIimqVEbp] [-o option_name] [+o option_name] command_string
[command_name [argument ...]]
dash -s [-aCefnuvxIimqVEbp] [+aCefnuvxIimqVEbp] [-o option_name] [+o option_name] [argument ...]






Command Line Options:

-a
allexport Export all variables assigned to.
sh -a ...
-C
noclobber Don't overwrite existing files with “>”.
sh -C ...
-f
noglob Disable pathname expansion.
sh -f ...
-v
verbose The shell writes its input to standard error as it is read. Useful for debugging.
sh -v ...
-I
ignoreeof Ignore EOF's from input when interactive.
sh -I ...
-i
interactive Force the shell to behave interactively.
sh -i ...
-l
Make dash act as if it had been invoked as a login shell.
sh -l ...
-m
monitor Turn on job control (set automatically when interactive).
sh -m ...
-V
vi Enable the built-in vi(1) command line editor (disables -E if it has been set).
sh -V ...
-E
emacs Enable the built-in emacs(1) command line editor (disables -V if it has been set).
sh -E ...
-p
default to help avoid incorrect usage by setuid root programs via system(3) or popen(3).Lexical StructureThe shell reads input in terms of lines from a file and breaks it up into words at whitespace (blanks and tabs),and at certain sequences of characters that are special to the shell called “operators”. There are two types ofoperators: control operators and redirection operators (their meaning is discussed later). Following is a listof operators:Control operators:& && ( ) ; ;; | || <newline>Redirection operators:< > >| << >> <& >& <<- <>QuotingQuoting is used to remove the special meaning of certain characters or words to the shell, such as operators,whitespace, or keywords. There are three types of quoting: matched single quotes, matched double quotes, andbackslash.BackslashA backslash preserves the literal meaning of the following character, with the exception of ⟨newline⟩. A back‐slash preceding a ⟨newline⟩ is treated as a line continuation.Single QuotesEnclosing characters in single quotes preserves the literal meaning of all the characters (except single quotes,making it impossible to put single-quotes in a single-quoted string).Double QuotesEnclosing characters within double quotes preserves the literal meaning of all characters except dollarsign ($),backquote (`), and backslash (\). The backslash inside double quotes is historically weird, and serves to quoteonly the following characters:$ ` " \ <newline>.Otherwise it remains literal.Reserved WordsReserved words are words that have special meaning to the shell and are recognized at the beginning of a lineand after a control operator. The following are reserved words:! elif fi while caseelse for then { }do done until if esacTheir meaning is discussed later.AliasesAn alias is a name and corresponding value set using the alias(1) builtin command. Whenever a reserved word mayoccur (see above), and after checking for reserved words, the shell checks the word to see if it matches analias. If it does, it replaces it in the input stream with its value. For example, if there is an alias called“lf” with the value “ls -F”, then the input:lf foobar ⟨return⟩would becomels -F foobar ⟨return⟩Aliases provide a convenient way for naive users to create shorthands for commands without having to learn howto create functions with arguments. They can also be used to create lexically obscure code. This use is dis‐couraged.CommandsThe shell interprets the words it reads according to a language, the specification of which is outside the scopeof this man page (refer to the BNF in the POSIX 1003.2 document). Essentially though, a line is read and if thefirst word of the line (or after a control operator) is not a reserved word, then the shell has recognized asimple command. Otherwise, a complex command or some other special construct may have been recognized.Simple CommandsIf a simple command has been recognized, the shell performs the following actions:1. Leading words of the form “name=value” are stripped off and assigned to the environment of the simplecommand. Redirection operators and their arguments (as described below) are stripped off and savedfor processing.2. The remaining words are expanded as described in the section called “Expansions”, and the firstremaining word is considered the command name and the command is located. The remaining words areconsidered the arguments of the command. If no command name resulted, then the “name=value” variableassignments recognized in item 1 affect the current shell.3. Redirections are performed as described in the next section.RedirectionsRedirections are used to change where a command reads its input or sends its output. In general, redirectionsopen, close, or duplicate an existing reference to a file. The overall format used for redirection is:[n] redir-op filewhere redir-op is one of the redirection operators mentioned previously. Following is a list of the possibleredirections. The [n] is an optional number, as in ‘3’ (not ‘[3]’), that refers to a file descriptor.[n]> file Redirect standard output (or n) to file.[n]>| file Same, but override the -C option.[n]>> file Append standard output (or n) to file.[n]< file Redirect standard input (or n) from file.[n1]<&n2 Duplicate standard input (or n1) from file descriptor n2.[n]<&- Close standard input (or n).[n1]>&n2 Duplicate standard output (or n1) to n2.[n]>&- Close standard output (or n).[n]<> file Open file for reading and writing on standard input (or n).The following redirection is often called a “here-document”.[n]<< delimiterhere-doc-text ...delimiterAll the text on successive lines up to the delimiter is saved away and made available to the command on standardinput, or file descriptor n if it is specified. If the delimiter as specified on the initial line is quoted,then the here-doc-text is treated literally, otherwise the text is subjected to parameter expansion, commandsubstitution, and arithmetic expansion (as described in the section on “Expansions”). If the operator is “<<-”instead of “<<”, then leading tabs in the here-doc-text are stripped.Search and ExecutionThere are three types of commands: shell functions, builtin commands, and normal programs -- and the command issearched for (by name) in that order. They each are executed in a different way.When a shell function is executed, all of the shell positional parameters (except $0, which remains unchanged)are set to the arguments of the shell function. The variables which are explicitly placed in the environment ofthe command (by placing assignments to them before the function name) are made local to the function and are setto the values given. Then the command given in the function definition is executed. The positional parametersare restored to their original values when the command completes. This all occurs within the current shell.Shell builtins are executed internally to the shell, without spawning a new process.Otherwise, if the command name doesn't match a function or builtin, the command is searched for as a normal pro‐gram in the file system (as described in the next section). When a normal program is executed, the shell runsthe program, passing the arguments and the environment to the program. If the program is not a normal exe‐cutable file (i.e., if it does not begin with the "magic number" whose ASCII representation is "#!", soexecve(2) returns ENOEXEC then) the shell will interpret the program in a subshell. The child shell will reini‐tialize itself in this case, so that the effect will be as if a new shell had been invoked to handle the ad-hocshell script, except that the location of hashed commands located in the parent shell will be remembered by thechild.Note that previous versions of this document and the source code itself misleadingly and sporadically refer to ashell script without a magic number as a "shell procedure".Path SearchWhen locating a command, the shell first looks to see if it has a shell function by that name. Then it looksfor a builtin command by that name. If a builtin command is not found, one of two things happen:1. Command names containing a slash are simply executed without performing any searches.2. The shell searches each entry in PATH in turn for the command. The value of the PATH variable should be aseries of entries separated by colons. Each entry consists of a directory name. The current directory maybe indicated implicitly by an empty directory name, or explicitly by a single period.Command Exit StatusEach command has an exit status that can influence the behaviour of other shell commands. The paradigm is thata command exits with zero for normal or success, and non-zero for failure, error, or a false indication. Theman page for each command should indicate the various exit codes and what they mean. Additionally, the builtincommands return exit codes, as does an executed shell function.If a command consists entirely of variable assignments then the exit status of the command is that of the lastcommand substitution if any, otherwise 0.Complex CommandsComplex commands are combinations of simple commands with control operators or reserved words, together creatinga larger complex command. More generally, a command is one of the following:· simple command· pipeline· list or compound-list· compound command· function definitionUnless otherwise stated, the exit status of a command is that of the last simple command executed by the com‐mand.PipelinesA pipeline is a sequence of one or more commands separated by the control operator |. The standard output ofall but the last command is connected to the standard input of the next command. The standard output of thelast command is inherited from the shell, as usual.The format for a pipeline is:[!] command1 [| command2 ...]The standard output of command1 is connected to the standard input of command2. The standard input, standardoutput, or both of a command is considered to be assigned by the pipeline before any redirection specified byredirection operators that are part of the command.If the pipeline is not in the background (discussed later), the shell waits for all commands to complete.If the reserved word ! does not precede the pipeline, the exit status is the exit status of the last commandspecified in the pipeline. Otherwise, the exit status is the logical NOT of the exit status of the last com‐mand. That is, if the last command returns zero, the exit status is 1; if the last command returns greater thanzero, the exit status is zero.Because pipeline assignment of standard input or standard output or both takes place before redirection, it canbe modified by redirection. For example:$ command1 2>&1 | command2sends both the standard output and standard error of command1 to the standard input of command2.A ; or ⟨newline⟩ terminator causes the preceding AND-OR-list (described next) to be executed sequentially; a &causes asynchronous execution of the preceding AND-OR-list.Note that unlike some other shells, each process in the pipeline is a child of the invoking shell (unless it isa shell builtin, in which case it executes in the current shell -- but any effect it has on the environment iswiped).Background Commands -- &If a command is terminated by the control operator ampersand (&), the shell executes the command asynchronously
sh -p ...
--
The format for running a command in background is:command1 & [command2 & ...]If the shell is not interactive, the standard input of an asynchronous command is set to /dev/null.Lists -- Generally SpeakingA list is a sequence of zero or more commands separated by newlines, semicolons, or ampersands, and optionallyterminated by one of these three characters. The commands in a list are executed in the order they are written.If command is followed by an ampersand, the shell starts the command and immediately proceed onto the next com‐mand; otherwise it waits for the command to terminate before proceeding to the next one.Short-Circuit List Operators“&&” and “||” are AND-OR list operators. “&&” executes the first command, and then executes the second commandiff the exit status of the first command is zero. “||” is similar, but executes the second command iff the exitstatus of the first command is nonzero. “&&” and “||” both have the same priority.Flow-Control Constructs -- if, while, for, caseThe syntax of the if command isif listthen list[ elif listthen list ] ...[ else list ]fiThe syntax of the while command iswhile listdo listdoneThe two lists are executed repeatedly while the exit status of the first list is zero. The until command issimilar, but has the word until in place of while, which causes it to repeat until the exit status of the firstlist is zero.The syntax of the for command isfor variable [ in [ word ... ] ]do listdoneThe words following in are expanded, and then the list is executed repeatedly with the variable set to each wordin turn. Omitting in word ... is equivalent to in "$@".The syntax of the break and continue command isbreak [ num ]continue [ num ]Break terminates the num innermost for or while loops. Continue continues with the next iteration of the inner‐most loop. These are implemented as builtin commands.The syntax of the case command iscase word in[(]pattern) list ;;...esacThe pattern can actually be one or more patterns (see Shell Patterns described later), separated by “|” charac‐ters. The “(” character before the pattern is optional.Grouping Commands TogetherCommands may be grouped by writing either(list)or{ list; }The first of these executes the commands in a subshell. Builtin commands grouped into a (list) will not affectthe current shell. The second form does not fork another shell so is slightly more efficient. Grouping com‐mands together this way allows you to redirect their output as though they were one program:{ printf " hello " ; printf " world\n" ; } > greetingNote that “}” must follow a control operator (here, “;”) so that it is recognized as a reserved word and not asanother command argument.FunctionsThe syntax of a function definition isname () commandA function definition is an executable statement; when executed it installs a function named name and returns anexit status of zero. The command is normally a list enclosed between “{” and “}”.Variables may be declared to be local to a function by using a local command. This should appear as the firststatement of a function, and the syntax islocal [variable | -] ...Local is implemented as a builtin command.When a variable is made local, it inherits the initial value and exported and readonly flags from the variablewith the same name in the surrounding scope, if there is one. Otherwise, the variable is initially unset. Theshell uses dynamic scoping, so that if you make the variable x local to function f, which then calls function g,references to the variable x made inside g will refer to the variable x declared inside f, not to the globalvariable named x.The only special parameter that can be made local is “-”. Making “-” local any shell options that are changedvia the set command inside the function to be restored to their original values when the function returns.The syntax of the return command isreturn [exitstatus]It terminates the currently executing function. Return is implemented as a builtin command.Variables and ParametersThe shell maintains a set of parameters. A parameter denoted by a name is called a variable. When starting up,the shell turns all the environment variables into shell variables. New variables can be set using the formname=valueVariables set by the user must have a name consisting solely of alphabetics, numerics, and underscores - thefirst of which must not be numeric. A parameter can also be denoted by a number or a special character asexplained below.Positional ParametersA positional parameter is a parameter denoted by a number (n > 0). The shell sets these initially to the valuesof its command line arguments that follow the name of the shell script. The set builtin can also be used to setor reset them.Special ParametersA special parameter is a parameter denoted by one of the following special characters. The value of the parame‐ter is listed next to its character.* Expands to the positional parameters, starting from one. When the expansion occurs within a dou‐ble-quoted string it expands to a single field with the value of each parameter separated by thefirst character of the IFS variable, or by a ⟨space⟩ if IFS is unset.@ Expands to the positional parameters, starting from one. When the expansion occurs within double-quotes, each positional parameter expands as a separate argument. If there are no positionalparameters, the expansion of @ generates zero arguments, even when @ is double-quoted. What thisbasically means, for example, is if $1 is “abc” and $2 is “def ghi”, then "$@" expands to the twoarguments:"abc" "def ghi"# Expands to the number of positional parameters.? Expands to the exit status of the most recent pipeline.
sh -- ...
-e
Use the editor named by editor to edit the commands. The editor string is a command name, subjectto search via the PATH variable. The value in the FCEDIT variable is used as a default when -e isnot specified. If FCEDIT is null or unset, the value of the EDITOR variable is used. If EDITORis null or unset, ed(1) is used as the editor.
sh -e ...
-n
Suppress command numbers when listing with -l.
sh -n ...
-r
Reverse the order of the commands listed (with -l) or edited (with neither -l nor -s).
sh -r ...
-s
firstlast Select the commands to list or edit. The number of previous commands that can be accessed aredetermined by the value of the HISTSIZE variable. The value of first or last or both are one ofthe following:[+]numberA positive number representing a command number; command numbers can be displayed with the
sh -s ...
-number
A negative decimal number representing the command that was executed number of commandspreviously. For example, -1 is the immediately previous command.stringA string indicating the most recently entered command that begins with that string. If theold=new operand is not also specified with -s, the string form of the first operand cannot containan embedded equal sign.The following environment variables affect the execution of fc:FCEDIT Name of the editor to use.HISTSIZE The number of previous commands that are accessible.fg [job]Move the specified job or the current job to the foreground.getopts optstring varThe POSIX getopts command, not to be confused with the Bell Labs -derived getopt(1).The first argument should be a series of letters, each of which may be optionally followed by a colon toindicate that the option requires an argument. The variable specified is set to the parsed option.The getopts command deprecates the older getopt(1) utility due to its handling of arguments containingwhitespace.The getopts builtin may be used to obtain options and their arguments from a list of parameters. Wheninvoked, getopts places the value of the next option from the option string in the list in the shellvariable specified by var and its index in the shell variable OPTIND. When the shell is invoked, OPTINDis initialized to 1. For each option that requires an argument, the getopts builtin will place it in theshell variable OPTARG. If an option is not allowed for in the optstring, then OPTARG will be unset.optstring is a string of recognized option letters (see getopt(3)). If a letter is followed by a colon,the option is expected to have an argument which may or may not be separated from it by white space. Ifan option character is not found where expected, getopts will set the variable var to a “?”; getopts willthen unset OPTARG and write output to standard error. By specifying a colon as the first character ofoptstring all errors will be ignored.A nonzero value is returned when the last option is reached. If there are no remaining arguments,getopts will set var to the special option, “--”, otherwise, it will set var to “?”.The following code fragment shows how one might process the arguments for a command that can take theoptions [a] and [b], and the option [c], which requires an argument.while getopts abc: fdocase $f ina | b) flag=$f;;c) carg=$OPTARG;;\?) echo $USAGE; exit 1;;esacdoneshift `expr $OPTIND - 1`This code will accept any of the following as equivalent:cmd -acarg file filecmd -a -c arg file filecmd -carg -a file filecmd -a -carg -- file filehash -rv command ...The shell maintains a hash table which remembers the locations of commands. With no arguments whatso‐ever, the hash command prints out the contents of this table. Entries which have not been looked atsince the last cd command are marked with an asterisk; it is possible for these entries to be invalid.With arguments, the hash command removes the specified commands from the hash table (unless they arefunctions) and then locates them. With the -v option, hash prints the locations of the commands as itfinds them. The -r option causes the hash command to delete all the entries in the hash table except forfunctions.pwd [-LP]builtin command remembers what the current directory is rather than recomputing it each time. This makesit faster. However, if the current directory is renamed, the builtin version of pwd will continue toprint the old name for the directory. The -P option causes the physical value of the current workingdirectory to be shown, that is, all symbolic links are resolved to their respective values. The -Loption turns off the effect of any preceding -P options.read [-p prompt] [-r] variable [...]The prompt is printed if the -p option is specified and the standard input is a terminal. Then a line isread from the standard input. The trailing newline is deleted from the line and the line is split asdescribed in the section on word splitting above, and the pieces are assigned to the variables in order.At least one variable must be specified. If there are more pieces than variables, the remaining pieces(along with the characters in IFS that separated them) are assigned to the last variable. If there aremore variables than pieces, the remaining variables are assigned the null string. The read builtin willindicate success unless EOF is encountered on input, in which case failure is returned.By default, unless the -r option is specified, the backslash “\” acts as an escape character, causing thefollowing character to be treated literally. If a backslash is followed by a newline, the backslash andthe newline will be deleted.readonly name ...readonly -pThe specified names are marked as read only, so that they cannot be subsequently modified or unset. Theshell allows the value of a variable to be set at the same time it is marked read only by writingreadonly name=valueWith no arguments the readonly command lists the names of all read only variables. With the -p optionspecified the output will be formatted suitably for non-interactive use.printf format [arguments ...]printf formats and prints its arguments, after the first, under control of the format. The format is acharacter string which contains three types of objects: plain characters, which are simply copied tostandard output, character escape sequences which are converted and copied to the standard output, andformat specifications, each of which causes printing of the next successive argument.The arguments after the first are treated as strings if the corresponding format is either b, c or s;otherwise it is evaluated as a C constant, with the following extensions:· A leading plus or minus sign is allowed.· If the leading character is a single or double quote, the value is the ASCII code of the nextcharacter.The format string is reused as often as necessary to satisfy the arguments. Any extra format specifica‐tions are evaluated with zero or the null string.Character escape sequences are in backslash notation as defined in ANSI X3.159-1989 (“ANSI C89”). Thecharacters and their meanings are as follows:\a Write a <bell> character.\b Write a <backspace> character.\e Write an <escape> (ESC) character.\f Write a <form-feed> character.\n Write a <new-line> character.\r Write a <carriage return> character.\t Write a <tab> character.\v Write a <vertical tab> character.\\ Write a backslash character.\num Write an 8-bit character whose ASCII value is the 1-, 2-, or 3-digit octal number num.Each format specification is introduced by the percent character (``%''). The remainder of the formatspecification includes, in the following order:Zero or more of the following flags:# A `#' character specifying that the value should be printed in an ``alternative form''.For b, c, d, and s formats, this option has no effect. For the o format the precision ofthe number is increased to force the first character of the output string to a zero. Forthe x (X) format, a non-zero result has the string 0x (0X) prepended to it. For e, E, f,g, and G formats, the result will always contain a decimal point, even if no digits fol‐low the point (normally, a decimal point only appears in the results of those formats ifa digit follows the decimal point). For g and G formats, trailing zeros are not removedfrom the result as they would otherwise be.
sh -number ...
-
+ A `+' character specifying that there should always be a sign placed before the numberwhen using signed formats.‘ ’ A space specifying that a blank should be left before a positive number for a signed for‐mat. A `+' overrides a space if both are used;0 A zero `0' character indicating that zero-padding should be used rather than blank-pad‐ding. A `-' overrides a `0' if both are used;Field Width:An optional digit string specifying a field width; if the output string has fewer characters thanthe field width it will be blank-padded on the left (or right, if the left-adjustment indicatorhas been given) to make up the field width (note that a leading zero is a flag, but an embeddedzero is part of a field width);Precision:An optional period, ‘.’, followed by an optional digit string giving a precision which specifiesthe number of digits to appear after the decimal point, for e and f formats, or the maximum num‐ber of bytes to be printed from a string (b and s formats); if the digit string is missing, theprecision is treated as zero;Format:A character which indicates the type of format to use (one of diouxXfwEgGbcs).A field width or precision may be ‘*’ instead of a digit string. In this case an argument supplies thefield width or precision.The format characters and their meanings are:diouXx The argument is printed as a signed decimal (d or i), unsigned octal, unsigned decimal, orunsigned hexadecimal (X or x), respectively.f The argument is printed in the style [-]ddd.ddd where the number of d's after the decimalpoint is equal to the precision specification for the argument. If the precision is missing,6 digits are given; if the precision is explicitly 0, no digits and no decimal point areprinted.eE The argument is printed in the style [-]d.ddde±dd where there is one digit before the decimalpoint and the number after is equal to the precision specification for the argument; when theprecision is missing, 6 digits are produced. An upper-case E is used for an `E' format.gG The argument is printed in style f or in style e (E) whichever gives full precision in mini‐mum space.b Characters from the string argument are printed with backslash-escape sequences expanded.The following additional backslash-escape sequences are supported:\c Causes dash to ignore any remaining characters in the string operand containing it,any remaining string operands, and any additional characters in the format operand.\0num Write an 8-bit character whose ASCII value is the 1-, 2-, or 3-digit octal numbernum.c The first character of argument is printed.s Characters from the string argument are printed until the end is reached or until the numberof bytes indicated by the precision specification is reached; if the precision is omitted,all characters in the string are printed.% Print a `%'; no argument is used.In no case does a non-existent or small field width cause truncation of a field; padding takes place onlyif the specified field width exceeds the actual width.set [{ -options | +options | -- }] arg ...The set command performs three different functions.With no arguments, it lists the values of all shell variables.If options are given, it sets the specified option flags, or clears them as described in the sectioncalled Argument List Processing. As a special case, if the option is -o or +o and no argument is sup‐plied, the shell prints the settings of all its options. If the option is -o, the settings are printedin a human-readable format; if the option is +o, the settings are printed in a format suitable for rein‐put to the shell to affect the same option settings.The third use of the set command is to set the values of the shell's positional parameters to the speci‐fied args. To change the positional parameters without changing any options, use “--” as the first argu‐ment to set. If no args are present, the set command will clear all the positional parameters (equiva‐lent to executing “shift $#”.)shift [n]Shift the positional parameters n times. A shift sets the value of $1 to the value of $2, the value of$2 to the value of $3, and so on, decreasing the value of $# by one. If n is greater than the number ofpositional parameters, shift will issue an error message, and exit with return status 2.test expression[ expression ]The test utility evaluates the expression and, if it evaluates to true, returns a zero (true) exit sta‐tus; otherwise it returns 1 (false). If there is no expression, test also returns 1 (false).All operators and flags are separate arguments to the test utility.The following primaries are used to construct expression:
sh - ...
-b
file True if file exists and is a block special file.
sh -b ...
-c
file True if file exists and is a character special file.
sh -c ...
-d
file True if file exists and is a directory.
sh -d ...
-g
file True if file exists and its set group ID flag is set.
sh -g ...
-h
file True if file exists and is a symbolic link.
sh -h ...
-k
file True if file exists and its sticky bit is set.
sh -k ...
-t
True if the file whose file descriptor number is file_descriptor is open and is associatedwith a terminal.
sh -t ...
-u
file True if file exists and its set user ID flag is set.
sh -u ...
-z
string True if the length of string is zero.
sh -z ...
-O
file True if file exists and its owner matches the effective user id of this process.
sh -O ...
-G
file True if file exists and its group matches the effective group id of this process.
sh -G ...
-S
file1 -nt file2True if file1 and file2 exist and file1 is newer than file2.file1 -ot file2True if file1 and file2 exist and file1 is older than file2.file1 -ef file2True if file1 and file2 exist and refer to the same file.string True if string is not the null string.s1 = s2 True if the strings s1 and s2 are identical.s1 != s2 True if the strings s1 and s2 are not identical.s1 < s2 True if string s1 comes before s2 based on the ASCII value of their characters.s1 > s2 True if string s1 comes after s2 based on the ASCII value of their characters.n1 -eq n2 True if the integers n1 and n2 are algebraically equal.n1 -ne n2 True if the integers n1 and n2 are not algebraically equal.n1 -gt n2 True if the integer n1 is algebraically greater than the integer n2.n1 -ge n2 True if the integer n1 is algebraically greater than or equal to the integer n2.n1 -lt n2 True if the integer n1 is algebraically less than the integer n2.n1 -le n2 True if the integer n1 is algebraically less than or equal to the integer n2.These primaries can be combined with the following operators:! expression True if expression is false.expression1 -a expression2True if both expression1 and expression2 are true.expression1 -o expression2True if either expression1 or expression2 are true.(expression) True if expression is true.The -a operator has higher precedence than the -o operator.times Print the accumulated user and system times for the shell and for processes run from the shell. Thereturn status is 0.trap [action signal ...]Cause the shell to parse and execute action when any of the specified signals are received. The signalsare specified by signal number or as the name of the signal. If signal is 0 or EXIT, the action is exe‐cuted when the shell exits. action may be empty (''), which causes the specified signals to be ignored.With action omitted or set to `-' the specified signals are set to their default action. When the shellforks off a subshell, it resets trapped (but not ignored) signals to the default action. The trap com‐mand has no effect on signals that were ignored on entry to the shell. trap without any arguments causeit to write a list of signals and their associated action to the standard output in a format that issuitable as an input to the shell that achieves the same trapping results.Examples:trapList trapped signals and their corresponding actiontrap '' INT QUIT tstp 30Ignore signals INT QUIT TSTP USR1trap date INTPrint date upon receiving signal INTtype [name ...]Interpret each name as a command and print the resolution of the command search. Possible resolutionsare: shell keyword, alias, shell builtin, command, tracked alias and not found. For aliases the aliasexpansion is printed; for commands and tracked aliases the complete pathname of the command is printed.ulimit [-H | -S] [-a | -tfdscmlpn [value]]Inquire about or set the hard or soft limits on processes or set new limits. The choice between hardlimit (which no process is allowed to violate, and which may not be raised once it has been lowered) andsoft limit (which causes processes to be signaled but not necessarily killed, and which may be raised) ismade with these flags:
sh -S ...
-H
set or inquire about hard limits
sh -H ...