Query: read
OS: hpux
Section: 1
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
read(1) General Commands Manual read(1)NAMEread - read a line from standard inputSYNOPSISvar ...DESCRIPTIONreads a single line from standard input. The line is split into fields as when processed by the shell (refer to shells in the first field is assigned to the first variable var, the second field to the second variable var, and so forth. If there are more fields than there are specified var operands, the remaining fields and their intervening separators are assigned to the last var. If there are more vars than fields, the remaining vars are set to empty strings. The setting of variables specified by the var operands affect the current shell execution environment. Standard input to can be redirected from a text file. Since affects the current shell execution environment, it is usually provided as a normal shell special (built-in) command. Thus, if it is called in a subshell or separate utility execution environment similar to the following, it does not affect the shell variables in the caller's environment: Options recognizes the following options: Do not treat a backslash character in any special way. Consider each backslash to be part of the input line. Opperands recognizes the following operands: var The name of an existing or nonexisting shell variable.EXTERNAL INFLUENCESEnvironment Variables determines the internal field separators used to delimit fields.RETURN VALUEexits with one of the following values: 0 Successful completion. >0 End-of-file was detected or an error occurred.EXAMPLESPrint a file with the first field of each line moved to the end of the line. while read -r xx yy do printf "%s %s " "$yy" "$xx" done < input_fileSEE ALSOcsh(1), ksh(1), sh(1), sh-posix(1).STANDARDS CONFORMANCEread(1)
Related Man Pages |
---|
cd(1) - hpux |
uniq(1) - hpux |
read(1p) - posix |
read(9e) - linux |
read(1) - php |