From 7ddecde54372c25fcf526e2d24807c5dac9800aa Mon Sep 17 00:00:00 2001 From: axel Date: Tue, 20 Sep 2005 23:31:55 +1000 Subject: Add subdirectories darcs-hash:20050920133155-ac50b-9a14c6c664dd03afbe8e15e7c7998fcfb5c3c750.gz --- doc_src/read.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 doc_src/read.txt (limited to 'doc_src/read.txt') diff --git a/doc_src/read.txt b/doc_src/read.txt new file mode 100644 index 00000000..4af02294 --- /dev/null +++ b/doc_src/read.txt @@ -0,0 +1,26 @@ +\section read read - read line of input into variables + +\subsection read-synopsis Synopsis +read [OPTIONS] [VARIABLES...] + +\subsection read-description Description + +The read builtin causes fish to read one line from standard +input and store the result in one or more environment variables. + +- -e or --export specifies that the variables will be exported to subshells. +- -g or --global specifies that the variables will be made global. +- -pPROMPT_CMD or --prompt=PROMPT_CMD specifies that the output of the shell command PROMPT_CMD should be used as the prompt for the interactive mode prompt. The default prompt command is set_color green; echo read; set_color normal; echo "> ". +- -cCMD or --command=CMD specifies that the initial string in the interactive mode command buffer should be CMD. + +Read starts by reading a single line of input from stdin, the line is +then tokenized using the IFS environment variable. Each variable +specified in VARIABLES is then assigned one tokenized string +element. If there are more tokens than variables, the complete +remainder is assigned to the last variable. + +\subsection read-example Example + +echo hello|read foo + +Will cause the variable \$foo to be assigned the value hello. -- cgit v1.2.3