Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Built-in Commands > read - Pg. 483

read - n Rotate the stack to place the nth directory from the bottom of the stack at the top. pwd pwd [-P] Description Display the current working directory's absolute pathname. By default, any symbolic directories used when reaching the current directory are displayed, but with the -P option the real names are displayed instead. read read [options] variable1 [variable2 ...] Description Read one line of standard input, and assign each word (as defined by IFS) to the corresponding variable, with all leftover words assigned to the last variable. If only one variable is specified, the entire line will be assigned to that variable. The return status is 0 unless EOF is reached, a distinction that is useful for running loops over input files. If no variable names are provided, read the entire string into the environment variable REPLY. Options -a var Read each word into an element of var, which is treated as an array variable. -d char Stop reading the line at char instead of at the newline. -e Line editing and command history are enabled during input. -n num Read only num characters from the line. -p string Display the prompt string to the user before reading each line, if input is interactive. -r Raw mode; ignore \ as a line continuation character. -s Do not echo the characters entered by the user (useful for reading a password). -t seconds Time out and return without setting any variables if input is interactive and no input has been entered for seconds seconds. bash: The Bourne- Again Shell Chapter 7:bash: The Bourne-Again Shell | 483