Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Noob question: How to check the total number of inputs entered by user? Post 303042047 by wisecracker on Thursday 12th of December 2019 08:26:43 AM
Old 12-12-2019
Hi jejemonx...
This is what vbe was referring to assuming you are using 'bash':
Code:
Last login: Thu Dec 12 13:15:18 on ttys000
AMIGA:amiga~> bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.
AMIGA:amiga~> 
AMIGA:amiga~> 
AMIGA:amiga~> help read
read: read [-ers] [-u fd] [-t timeout] [-p prompt] [-a array] [-n nchars] [-d delim] [name ...]
    One line is read from the standard input, or from file descriptor FD if the
    -u option is supplied, and the first word is assigned to the first NAME,
    the second word to the second NAME, and so on, with leftover words assigned
    to the last NAME.  Only the characters found in $IFS are recognized as word
    delimiters.  If no NAMEs are supplied, the line read is stored in the REPLY
    variable.  If the -r option is given, this signifies `raw' input, and
    backslash escaping is disabled.  The -d option causes read to continue
    until the first character of DELIM is read, rather than newline.  If the -p
    option is supplied, the string PROMPT is output without a trailing newline
    before attempting to read.  If -a is supplied, the words read are assigned
    to sequential indices of ARRAY, starting at zero.  If -e is supplied and
    the shell is interactive, readline is used to obtain the line.  If -n is
    supplied with a non-zero NCHARS argument, read returns after NCHARS
    characters have been read.  The -s option causes input coming from a
    terminal to not be echoed.
    
    The -t option causes read to time out and return failure if a complete line
    of input is not read within TIMEOUT seconds.  If the TMOUT variable is set,
    its value is the default timeout.  The return code is zero, unless end-of-file
    is encountered, read times out, or an invalid file descriptor is supplied as
    the argument to -u.
readonly: readonly [-af] [name[=value] ...] or readonly -p
    The given NAMEs are marked readonly and the values of these NAMEs may
    not be changed by subsequent assignment.  If the -f option is given,
    then functions corresponding to the NAMEs are so marked.  If no
    arguments are given, or if `-p' is given, a list of all readonly names
    is printed.  The `-a' option means to treat each NAME as
    an array variable.  An argument of `--' disables further option
    processing.
AMIGA:amiga~> _

AND, an example of how it works:
Code:
Last login: Thu Dec 12 13:15:49 on ttys000
AMIGA:amiga~> read a b c
1
AMIGA:amiga~> echo "${a} ${b} ${c}"
1  
AMIGA:amiga~> read a b c
1 2
AMIGA:amiga~> echo "${a} ${b} ${c}"
1 2 
AMIGA:amiga~> read a b c
1 2 3
AMIGA:amiga~> echo "${a} ${b} ${c}"
1 2 3
AMIGA:amiga~> _

As you can see whether you input variables 'b' and 'c' or not they have 'NULL' values so there will always be 3 variables.
You could always use 3 separate 'read's and check each one for validity and restart the loop as required if one or more is not a number...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash : how do i check the user input and make sure is only chracter or only number ?

Bash : how do i check the user input and make sure is only character or only number ? (7 Replies)
Discussion started by: CheeSen
7 Replies

2. Shell Programming and Scripting

validating user entered date

I need the date validation. I searched in the google but i didn't find my requirements. requirements: 1) user has to enter the date in YYYY/MM/DD format 2) MM validations 3) DD validations. and if the month is april it should allow 30 days only and for May month it should allow 31 days like... (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

3. High Performance Computing

PBS - restrict total number of processors per user

Hello everyone! I am a bit inexperienced with administering queueing programs. I installed Torque (a PBS derivative) on a Linux cluster and it is running well. There is one annoying problem though: users can run massively parallel jobs and serial jobs too. Almost all users do a mix of the two. I... (0 Replies)
Discussion started by: gnuplot
0 Replies

4. Shell Programming and Scripting

Total noob script

Hi i am a total noob at shell scripting. i was wondering if somebody could help me with my script. i want the script to search the dev folder for the burner file because they are different between distrubutions? as i under stand it. this i the script. #!/bin/bash echo "Script för att bränna 360... (4 Replies)
Discussion started by: MatsO
4 Replies

5. Shell Programming and Scripting

only a number can be entered no letters?

ok the user can only enter a number if a letter is entered it shouldnt be accepted This is what i have so far read -p "How many cars to enter:" cars until do read -p "Invalid number. Please re-enter:" $tags done (5 Replies)
Discussion started by: gangsta
5 Replies

6. Shell Programming and Scripting

Help with sum total number of record and total number of record problem asking

Input file SFSQW 5192.56 HNRNPK 611.486 QEQW 1202.15 ASDR 568.627 QWET 6382.11 SFSQW 4386.3 HNRNPK 100 SFSQW 500 Desired output file SFSQW 10078.86 3 QWET 6382.11 1 QEQW 1202.15 1 HNRNPK 711.49 2 ASDR 568.63 1 The way I tried: (2 Replies)
Discussion started by: patrick87
2 Replies

7. Shell Programming and Scripting

How to accept command line argument as character or text if number is entered?

Hello Does the unix korn shell provide a function to convert number entered in command line argument to text or Character so that in next step i will convert Chr to Hex (6 Replies)
Discussion started by: aadityapatel198
6 Replies

8. Shell Programming and Scripting

Print Unknown Number of User Inputs in awk

Hello, I am new to awk and I am trying to figure out how to print an output based on user input. For example: ubuntu:~/scripts$ steps="step1, step2, step3" ubuntu:~/scripts$ echo $steps step1, step2, step3 I am playing around and I got this pattern that I want: ... (3 Replies)
Discussion started by: tattoostreet
3 Replies

9. Shell Programming and Scripting

How to check user entered correct file format or not?

Hi Experts, path=/db/files/ format=$1 User can enter any file format.compare the user file format with actual file format existed in the directory /db/files. User enter all characters as "A" apart from date format. example1: user will be entering the file format AAA_AA_YYYYMMDD.AAA Actual... (6 Replies)
Discussion started by: nalu
6 Replies

10. Shell Programming and Scripting

Total Noob BASH scripting question

Hello All, I have a file of ip addresses called activeips.txt What I'm trying to do is run a simple bash script that has a loop in it. The loop is a cat of the IP addresses in the file. The goal is to run 2 nmap commands to give me outputs where each address in the list has an OS... (11 Replies)
Discussion started by: Dirk_Pitt
11 Replies
CRM_SHADOW(8)							  [FIXME: manual]						     CRM_SHADOW(8)

NAME
crm_shadow - Perform Configuration Changes in a Sandbox Before Updating The Live Cluster SYNOPSIS
crm_shadow [-V] [-p|-e|-q] DESCRIPTION
Sets up an environment in which configuration tools (cibadmin, crm_resource, etc) work offline instead of against a live cluster, allowing changes to be previewed and tested for side-effects. OPTIONS
--verbose, -V turn on debug info. additional instance increase verbosity --which, -w indicate the active shadow copy --display, -p display the contents of the shadow copy --diff, -d display the changes in the shadow copy --create-empty, -eNAME create the named shadow copy with an empty cluster configuration --create, -cNAME create the named shadow copy of the active cluster configuration --reset, -rNAME recreate the named shadow copy from the active cluster configuration --commit, -cNAME upload the contents of the named shadow copy to the cluster --delete, -dNAME delete the contents of the named shadow copy --edit, -eNAME Edit the contents of the named shadow copy with your favorite editor --batch, -b do not spawn a new shell --force, -f do not spawn a new shell --switch, -s switch to the named shadow copy INTERNAL COMMANDS
To work with a shadow configuration, you need to create one first: crm_shadow --create-empty YOUR_NAME It gives you an internal shell like the one from the crm tool. Use help to get an overview of all internal commands, or help subcommand for a specific command. Table 1. Overview of Internal Commands +----------------+------------------------------------------------------------------------------------------------------+ | | | | Command | Syntax/Description | +----------------+------------------------------------------------------------------------------------------------------+ | | alias [-p] [name[=value] ... ] | | alias | | | | | | | .PP | | | | | | alias with no arguments or with the -p | | | option prints the list of aliases in the | | | form alias NAME=VALUE on standard output. | | | Otherwise, an alias is defined for each | | | NAME whose VALUE is given. A trailing | | | space in VALUE causes the next word to be | | | checked for alias substitution when the | | | alias is expanded. Alias returns true | | | unless a NAME is given for which no alias | | | has been defined. | +----------------+------------------------------------------------------------------------------------------------------+ | | bg [JOB_SPEC ...] | | bg | | | | | | | .PP Place each JOB_SPEC in the | | | background, as if it had been started with | | | &. If JOB_SPEC is not present, the shell's | | | notion of the current job is used. | +----------------+------------------------------------------------------------------------------------------------------+ | | bind [-lpvsPVS] [-m keymap] [-f filename] | | bind | [-q name] [-u name] [-r keyseq] | | | [-x keyseq:shell-command] | | | [keyseq:readline-function or readline-command] | | | | | | | | | .PP Bind a key sequence to a | | | Readline function or a macro, or set a | | | Readline variable. The non-option argument | | | syntax is equivalent to that found in | | | ~/.inputrc, but must be passed as a single | | | argument: bind "C-xC-r": | | | re-read-init-file. | +----------------+------------------------------------------------------------------------------------------------------+ | | break [N] | | break | | | | | | | .PP Exit from within a for, while or until | | | loop. If N is specified, break N levels. | +----------------+------------------------------------------------------------------------------------------------------+ | | builtin [shell-builtin [arg ...]] | | builtin | | | | | | | .PP Run a shell builtin. This is useful when | | | you wish to rename a shell builtin to be a function, | | | but need the functionality of the builtin within the | | | function itself. | +----------------+------------------------------------------------------------------------------------------------------+ | | caller [EXPR] | | caller | | | | | | | .PP Returns the context of the current | | | subroutine call. Without EXPR, returns $line | | | $filename. With EXPR, returns $line $subroutine | | | $filename; this extra information can be used to | | | provide a stack trace. | +----------------+------------------------------------------------------------------------------------------------------+ | | case WORD in [PATTERN [| PATTERN] [COMMANDS;;] ... esac | | case | | | | | | | .PP Selectively execute COMMANDS based upon | | | WORD matching PATTERN. The `|' is used to separate | | | multiple patterns. | +----------------+------------------------------------------------------------------------------------------------------+ | | cd [-L|-P] [dir] | | cd | | | | | | | .PP Change the current directory to DIR. | +----------------+------------------------------------------------------------------------------------------------------+ | | command [-pVv] | | command | command [arg ...] | | | | | | | | | .PP Runs COMMAND with ARGS ignoring shell functions. | | | If you have a shell function called `ls', and you wish to | | | call the command `ls', you can say "command ls". If the -p | | | option is given, a default value is used for PATH that is | | | guaranteed to find all of the standard utilities. If the -V | | | or -v option is given, a string is printed describing | | | COMMAND. The -V option produces a more verbose description. | +----------------+------------------------------------------------------------------------------------------------------+ | | compgen [-abcdefgjksuv] [-o option] [-A action] | | compgen | [-G globpat] [-W wordlist] [-P prefix] | | | [-S suffix] [-X filterpat] [-F function] | | | [-C command] [WORD] | | | | | | | | | .PP Display the possible completions depending on | | | the options. Intended to be used from within a shell | | | function generating possible completions. If the optional | | | WORD argument is supplied, matches against WORD are | | | generated. | +----------------+------------------------------------------------------------------------------------------------------+ | | complete [-abcdefgjksuv] [-pr] [-o option] | | complete | [-A action] [-G globpat] [-W wordlist] [-P prefix] | | | [-S suffix] [-X filterpat] [-F function] [-C command] | | | [name ...] | | | | | | | | | .PP For each NAME, specify how arguments are to be | | | completed. If the -p option is supplied, or if no options | | | are supplied, existing completion specifications are | | | printed in a way that allows them to be reused as input. | | | The -r option removes a completion specification for each | | | NAME, or, if no NAMEs are supplied, all completion | | | specifications. | +----------------+------------------------------------------------------------------------------------------------------+ | | continue [N] | | continue | | | | | | | .PP Resume the next iteration of the enclosing FOR, | | | WHILE or UNTIL loop. If N is specified, resume at the N-th | | | enclosing loop. | +----------------+------------------------------------------------------------------------------------------------------+ | | declare [-afFirtx] [-p] [name[=value] ...] | | declare | | | | | | | .PP Declare variables and/or give them attributes. If | | | no NAMEs are given, then display the values of variables | | | instead. The -p option will display the attributes and | | | values of each NAME. | +----------------+------------------------------------------------------------------------------------------------------+ | | dirs [-clpv] [+N] [-N] | | dirs | | | | | | | .PP Display the list of currently remembered | | | directories. Directories find their way onto the list with | | | the pushd command; you can get back up through the list with | | | the popd command. | | | | | | .PP | +----------------+------------------------------------------------------------------------------------------------------+ | | disown [-h] [-ar] [JOBSPEC ...] | | disown | | | | | | | .PP By default, removes each JOBSPEC argument from | | | the table of active jobs. If the -h option is given, the job | | | is not removed from the table, but is marked so that SIGHUP | | | is not sent to the job if the shell receives a SIGHUP. The | | | -a option, when JOBSPEC is not supplied, means to remove all | | | jobs from the job table; the -r option means to remove only | | | running jobs. | +----------------+------------------------------------------------------------------------------------------------------+ | | echo [-neE] [arg ...] | | echo | | | | | | | .PP Output the ARGs. If -n is specified, the trailing | | | newline is suppressed. If the -e option is given, | | | interpretation of the following backslash-escaped characters | | | is turned on: | | | | | | .RS 4 a (alert, bell) | | |  (backspace) | | | c (suppress trailing newline) | | | E (escape character) | | | f (form feed) | | | (new line) | | | (carriage return) | | | (horizontal tab) | | | v (vertical tab) | | | \ (backslash) | | | nnn (the character whose ASCII code is NNN (octal). | | | NNN can be | | | 0 to 3 octal digits) | | | .PP You can explicitly turn off the interpretation of | | | the above characters with the -E option. | +----------------+------------------------------------------------------------------------------------------------------+ | | enable [-pnds] [-a] [-f filename] [name...] | | enable | | | | | | | .PP Enable and disable builtin shell commands. This | | | allows you to use a disk command which has the same name as | | | a shell builtin without specifying a full pathname. If -n is | | | used, the NAMEs become disabled; otherwise NAMEs are | | | enabled. For example, to use the test found in $PATH instead | | | of the shell builtin version, type enable -n test. On | | | systems supporting dynamic loading, the -f option may be | | | used to load new builtins from the shared object FILENAME. | | | The -d option will delete a builtin previously loaded with | | | -f. If no non-option names are given, or the -p option is | | | supplied, a list of builtins is printed. The -a option means | | | to print every builtin with an indication of whether or not | | | it is enabled. The -s option restricts the output to the | | | POSIX.2 `special' builtins. The -n option displays a list of | | | all disabled builtins. | +----------------+------------------------------------------------------------------------------------------------------+ | | eval [ARG ...] | | eval | | | | | | | .PP Read ARGs as input to the shell and execute the | | | resulting command(s). | +----------------+------------------------------------------------------------------------------------------------------+ | | exec [-cl] [-a name] file [redirection ...] | | exec | | | | | | | .PP Exec FILE, replacing this shell with the | | | specified program. If FILE is not specified, the | | | redirections take effect in this shell. If the first | | | argument is -l, then place a dash in the zeroth arg passed | | | to FILE, as login does. If the -c option is supplied, FILE | | | is executed with a null environment. The -a option means to | | | make set argv[0] of the executed process to NAME. If the | | | file cannot be executed and the shell is not interactive, | | | then the shell exits, unless the shell option execfail is | | | set. | +----------------+------------------------------------------------------------------------------------------------------+ | | exit [N] | | exit | | | | | | | .PP Exit the shell with a status of N. If N is | | | omitted, the exit status is that of the last command | | | executed. | +----------------+------------------------------------------------------------------------------------------------------+ | | export [-nf] [NAME[=value] ...] | | export | export -p | | | | | | | | | .PP | | | | | | NAMEs are marked for automatic export to the environment of | | | subsequently executed commands. If the -f option is given, | | | the NAMEs refer to functions. If no NAMEs are given, or if | | | -p is given, a list of all names that are exported in this | | | shell is printed. An argument of -n says to remove the | | | export property from subsequent NAMEs. An argument of -- | | | disables further option processing. | +----------------+------------------------------------------------------------------------------------------------------+ | | false | | false | | | | | | | .PP Return an unsuccessful result. | +----------------+------------------------------------------------------------------------------------------------------+ | | fc [-e ename] [-nlr] [FIRST] [LAST] | | fc | fc -s [pat=rep] [cmd] | | | | | | | | | .PP fc is used to list or edit and re-execute | | | commands from the history list. FIRST and LAST can be | | | numbers specifying the range, or FIRST can be a string, | | | which means the most recent command beginning with that | | | string. | +----------------+------------------------------------------------------------------------------------------------------+ | | fg [JOB_SPEC] | | fg | | | | | | | .PP Place JOB_SPEC in the foreground, and make it the | | | current job. If JOB_SPEC is not present, the shell's notion | | | of the current job is used. | +----------------+------------------------------------------------------------------------------------------------------+ | | for NAME [in WORDS ... ;] do COMMANDS; done | | for | | | | | | | .PP The for loop executes a sequence of commands for | | | each member in a list of items. If in WORDS ...; is not | | | present, then in "$@" is assumed. For each element in WORDS, | | | NAME is set to that element, and the COMMANDS are executed. | +----------------+------------------------------------------------------------------------------------------------------+ | | function NAME { COMMANDS ; } | | function | function NAME () { COMMANDS ; } | | | | | | | | | .PP Create a simple command invoked by NAME which | | | runs COMMANDS. Arguments on the command line along with NAME | | | are passed to the function as $0 .. $n. | +----------------+------------------------------------------------------------------------------------------------------+ | | getopts OPTSTRING NAME [arg] | | getopts | | | | | | | .PP Getopts is used by shell procedures to parse | | | positional parameters. | | | | | | .PP | +----------------+------------------------------------------------------------------------------------------------------+ | | hash [-lr] [-p PATHNAME] [-dt] [NAME...] | | hash | | | | | | | .PP For each NAME, the full pathname of the command | | | is determined and remembered. If the -p option is supplied, | | | PATHNAME is used as the full pathname of NAME, and no path | | | search is performed. 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, information about remembered commands is displayed. | +----------------+------------------------------------------------------------------------------------------------------+ | | history [-c] [-d OFFSET] [n] | | history | history -ps arg [arg...] | | | history -awrm [filename] | | | | | | | | | .PP Display the history list with line numbers. Lines | | | listed with with a * have been modified. Argument of N says | | | to list only the last N lines. The -c option causes the | | | history list to be cleared by deleting all of the entries. | | | The -d option deletes the history entry at offset OFFSET. | | | The -w option writes out the current history to the history | | | file; -r means to read the file and append the contents to | | | the history list instead. -a means to append history lines | | | from this session to the history file. Argument -n means to | | | read all history lines not already read from the history | | | file and append them to the history list. | +----------------+------------------------------------------------------------------------------------------------------+ | | jobs [-lnprs] [JOBSPEC ...] | | jobs | job -x COMMAND [ARGS] | | | | | | | | | .PP Lists the active jobs. The -l option lists | | | process id's in addition to the normal information; the -p | | | option lists process id's only. If -n is given, only | | | processes that have changed status since the last | | | notification are printed. JOBSPEC restricts output to that | | | job. The -r and -s options restrict output to running and | | | stopped jobs only, respectively. Without options, the status | | | of all active jobs is printed. If -x is given, COMMAND is | | | run after all job specifications that appear in ARGS have | | | been replaced with the process ID of that job's process | | | group leader. | +----------------+------------------------------------------------------------------------------------------------------+ | | kill [-s sigspec | -n signum | -sigspec] pid | JOBSPEC ... | | kill | kill -l [sigspec] | | | | | | | | | .PP Send the processes named by PID (or JOBSPEC) the | | | signal SIGSPEC. If SIGSPEC is not present, then SIGTERM is | | | assumed. An argument of -l lists the signal names; if | | | arguments follow -l they are assumed to be signal numbers | | | for which names should be listed. Kill is a shell builtin | | | for two reasons: it allows job IDs to be used instead of | | | process IDs, and, if you have reached the limit on processes | | | that you can create, you don't have to start a process to | | | kill another one. | +----------------+------------------------------------------------------------------------------------------------------+ | | let ARG [ARG ...] | | let | | | | | | | .PP Each ARG is an arithmetic expression to be | | | evaluated. Evaluation is done in fixed-width integers with no | | | check for overflow, though division by 0 is trapped and | | | flagged as an error. The following list of operators is | | | grouped into levels of equal-precedence operators. The levels | | | are listed in order of decreasing precedence. | +----------------+------------------------------------------------------------------------------------------------------+ | | local NAME[=VALUE] ... | | local | | | | | | | .PP Create a local variable called NAME, and give it | | | VALUE. local can only be used within a function; it makes the | | | variable NAME have a visible scope restricted to that function | | | and its children. | +----------------+------------------------------------------------------------------------------------------------------+ | | logout | | logout | | | | | | | .PP Logout of a login shell. | +----------------+------------------------------------------------------------------------------------------------------+ | | popd [+N | -N] [-n] | | popd | | | | | | | .PP Removes entries from the directory stack. With no | | | arguments, removes the top directory from the stack, and cd's | | | to the new top directory. | +----------------+------------------------------------------------------------------------------------------------------+ | | printf [-v var] format [ARGUMENTS] | | printf | | | | | | | .PP printf formats and prints ARGUMENTS under control | | | of the FORMAT. FORMAT is a character string which contains | | | three types of objects: plain characters, which are simply | | | copied to standard output, character escape sequences which | | | are converted and copied to the standard output, and format | | | specifications, each of which causes printing of the next | | | successive argument. In addition to the standard printf(1) | | | formats, %b means to expand backslash escape sequences in the | | | corresponding argument, and %q means to quote the argument in | | | a way that can be reused as shell input. If the -v option is | | | supplied, the output is placed into the value of the shell | | | variable VAR rather than being sent to the standard output. | +----------------+------------------------------------------------------------------------------------------------------+ | | pushd [dir | +N | -N] [-n] | | pushd | | | | | | | .PP Adds a directory to the top of the directory stack, | | | or rotates the stack, making the new top of the stack the | | | current working directory. With no arguments, exchanges the | | | top two directories. | +----------------+------------------------------------------------------------------------------------------------------+ | | pwd [-LP] | | pwd | | | | | | | .PP Print the current working directory. With the -P | | | option, pwd prints the physical directory, without any | | | symbolic links; the -L option makes pwd follow symbolic links. | +----------------+------------------------------------------------------------------------------------------------------+ | | read [-ers] [-u fd] [-t timeout] [-p prompt] [-a array] [-n nchars] [-d delim] [NAME ...] | | read | | | | | | | .PP The given NAMEs are marked readonly and the values | | | of these NAMEs may not be changed by subsequent assignment. If | | | the -f option is given, then functions corresponding to the | | | NAMEs are so marked. If no arguments are given, or if -p is | | | given, a list of all readonly names is printed. The -a option | | | means to treat each NAME as an array variable. An argument of | | | -- disables further option processing. | +----------------+------------------------------------------------------------------------------------------------------+ | | readonly [-af] [NAME[=VALUE] ...] | | readonly | readonly -p | | | | | | | | | .PP The given NAMEs are marked readonly and the values of these NAMEs may not be | | | changed by subsequent assignment. If the -f option is given, then functions corresponding to | | | the NAMEs are so marked. If no arguments are given, or if -p is given, a list of all readonly | | | names is printed. The -a option means to treat each NAME as an array variable. An argument of | | | -- disables further option processing. | +----------------+------------------------------------------------------------------------------------------------------+ | | return [N] | | return | | | | | | | .PP Causes a function to exit with the return value specified by N. If N is omitted, | | | the return status is that of the last command. | +----------------+------------------------------------------------------------------------------------------------------+ | | select NAME [in WORDS ... ;] do COMMANDS; done | | select | | | | | | | .PP The WORDS are expanded, generating a list of words. The set of expanded words is | | | printed on the standard error, each preceded by a number. If in WORDS is not present, in "$@" | | | is assumed. The PS3 prompt is then displayed and a line read from the standard input. If the | | | line consists of the number corresponding to one of the displayed words, then NAME is set to | | | that word. If the line is empty, WORDS and the prompt are redisplayed. If EOF is read, the | | | command completes. Any other value read causes NAME to be set to null. The line read is saved | | | in the variable REPLY. COMMANDS are executed after each selection until a break command is | | | executed. | +----------------+------------------------------------------------------------------------------------------------------+ | | set [--abefhkmnptuvxBCHP] [-o OPTION] [ARG...] | | set | | | | | | | .PP Sets internal shell options. | +----------------+------------------------------------------------------------------------------------------------------+ | | shift [n] | | shift | | | | | | | .PP The positional parameters from $N+1 ... are renamed to $1 ... If N is not given, | | | it is assumed to be 1. | +----------------+------------------------------------------------------------------------------------------------------+ | | shopt [-pqsu] [-o long-option] OPTNAME [OPTNAME...] | | shopt | | | | | | | .PP Toggle the values of variables controlling optional behavior. The -s flag means to | | | enable (set) each OPTNAME; the -u flag unsets each OPTNAME. The -q flag suppresses output; | | | the exit status indicates whether each OPTNAME is set or unset. The -o option restricts the | | | OPTNAMEs to those defined for use with set -o. With no options, or with the -p option, a list | | | of all settable options is displayed, with an indication of whether or not each is set. | +----------------+------------------------------------------------------------------------------------------------------+ | | source FILENAME [ARGS] | | source | | | | | | | .PP Read and execute commands from FILENAME and return. The pathnames in $PATH are | | | used to find the directory containing FILENAME. If any ARGS are supplied, they become the | | | positional parameters when FILENAME is executed. | +----------------+------------------------------------------------------------------------------------------------------+ | | suspend [-f] | | suspend | | | | | | | .PP Suspend the execution of this shell until it receives a SIGCONT signal. The -f if | | | specified says not to complain about this being a login shell if it is; just suspend anyway. | +----------------+------------------------------------------------------------------------------------------------------+ | | test [expr] | | test | | | | | | | .PP Exits with a status of 0 (true) or 1 (false) depending on the evaluation of EXPR. | | | Expressions may be unary or binary. Unary expressions are often used to examine the status of | | | a file. There are string operators as well, and numeric comparison operators. | +----------------+------------------------------------------------------------------------------------------------------+ | | time [-p] PIPELINE | | time | | | | | | | .PP Execute PIPELINE and print a summary of the real time, user CPU time, and system | | | CPU time spent executing PIPELINE when it terminates. The return status is the return status | | | of PIPELINE. The -p option prints the timing summary in a slightly different format. This | | | uses the value of the TIMEFORMAT variable as the output format. | +----------------+------------------------------------------------------------------------------------------------------+ | | times | | times | | | | | | | .PP Print the accumulated user and system times for processes run from the shell. | +----------------+------------------------------------------------------------------------------------------------------+ | | trap [-lp] [ARG SIGNAL_SPEC ...] | | trap | | | | | | | .PP The command ARG is to be read and executed when the shell receives signal(s) | | | SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC is supplied) or -, each specified | | | signal is reset to its original value. If ARG is the null string each SIGNAL_SPEC is ignored | | | by the shell and by the commands it invokes. If a SIGNAL_SPEC is EXIT (0) the command ARG is | | | executed on exit from the shell. If a SIGNAL_SPEC is DEBUG, ARG is executed after every | | | simple command. If the -p option is supplied then the trap commands associated with each | | | SIGNAL_SPEC are displayed. If no arguments are supplied or if only -p is given, trap prints | | | the list of commands associated with each signal. Each SIGNAL_SPEC is either a signal name in | | | signal.h or a signal number. Signal names are case insensitive and the SIG prefix is | | | optional. trap -l prints a list of signal names and their corresponding numbers. Note that a | | | signal can be sent to the shell with kill -signal $$. | +----------------+------------------------------------------------------------------------------------------------------+ | | true | | true | | | | | | | .PP Return a successful result. | +----------------+------------------------------------------------------------------------------------------------------+ | | type [-afptP] NAME [NAME ...] | | type | | | | | | | | | | .PP Obsolete, see declare. | +----------------+------------------------------------------------------------------------------------------------------+ | | typeset [-afFirtx] [-p] name[=value] | | typeset | | | | | | | .PP Obsolete, see declare. | +----------------+------------------------------------------------------------------------------------------------------+ | | ulimit [-SHacdfilmnpqstuvx] [limit | | ulimit | | | | | | | .PP Ulimit provides control over the resources available to processes started by the | | | shell, on systems that allow such control. | +----------------+------------------------------------------------------------------------------------------------------+ | | umask [-p] [-S] [MODE] | | umask | | | | | | | .PP The user file-creation mask is set to MODE. If MODE is omitted, or if -S is | | | supplied, the current value of the mask is printed. The -S option makes the output symbolic; | | | otherwise an octal number is output. If -p is supplied, and MODE is omitted, the output is in | | | a form that may be used as input. If MODE begins with a digit, it is interpreted as an octal | | | number, otherwise it is a symbolic mode string like that accepted by chmod(1). | +----------------+------------------------------------------------------------------------------------------------------+ | | unalias [-a] NAME [NAME ...] | | unalias | | | | | | | .PP Remove NAMEs from the list of defined aliases. If the -a option is given, then | | | remove all alias definitions. | +----------------+------------------------------------------------------------------------------------------------------+ | | unset [-f] [-v] [NAME ...] | | unset | | | | | | | .PP For each NAME, remove the corresponding variable or function. Given the -v, unset | | | will only act on variables. Given the -f flag, unset will only act on functions. With neither | | | flag, unset first tries to unset a variable, and if that fails, then tries to unset a | | | function. Some variables cannot be unset; also see readonly. | +----------------+------------------------------------------------------------------------------------------------------+ | | until COMMANDS; do COMMANDS; done | | until | | | | | | | .PP Expand and execute COMMANDS as long as the final command in the until COMMANDS has | | | an exit status which is not zero. | +----------------+------------------------------------------------------------------------------------------------------+ | | wait [N] | | wait | | | | | | | .PP Wait for the specified process and report its termination status. If N is not | | | given, all currently active child processes are waited for, and the return code is zero. N | | | may be a process ID or a job specification; if a job spec is given, all processes in the | | | job's pipeline are waited for. | +----------------+------------------------------------------------------------------------------------------------------+ | | while COMMANDS; do COMMANDS; done | | while | | | | | | | .PP Expand and execute COMMANDS as long as the final command in the while COMMANDS has | | | an exit status of zero. | +----------------+------------------------------------------------------------------------------------------------------+ [FIXME: source] 07/05/2010 CRM_SHADOW(8)
All times are GMT -4. The time now is 07:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy