aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/read.txt
diff options
context:
space:
mode:
authorGravatar David Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au>2013-05-12 15:56:01 +0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-05-13 01:48:20 -0700
commit1287b9d82382bf22e16edda67eae755f07397f2e (patch)
tree811814b029d65ac11a193e616ca4a71d216dbe0c /doc_src/read.txt
parent91aab03b90a6b583a3c0ecff5b015c6066d34f28 (diff)
Help cleanup
Large list of changes, including formatting and typos for most commands. More substantive changes have been made to alias, bind, block, break, builtin, case, cd, commandline, count, else, emit, fish_config, funced, function, functions, history, math, mimedb, nextd, not, popd, prevd, pushd, pwd, random, read, set, set_color, switch, test, trap, type, ulimit, umask, and while.
Diffstat (limited to 'doc_src/read.txt')
-rw-r--r--doc_src/read.txt38
1 files changed, 20 insertions, 18 deletions
diff --git a/doc_src/read.txt b/doc_src/read.txt
index d69d715b..1e8aef37 100644
--- a/doc_src/read.txt
+++ b/doc_src/read.txt
@@ -5,27 +5,29 @@
\subsection read-description Description
-The <tt>read</tt> builtin causes fish to read one line from standard
-input and store the result in one or more environment variables.
+<tt>read</tt> reads one line from standard
+input and stores the result in one or more environment variables.
-- <tt>-c CMD</tt> or <tt>--command=CMD</tt> specifies that the initial string in the interactive mode command buffer should be CMD.
-- <tt>-g</tt> or <tt>--global</tt> specifies that the variables will be made global.
-- <tt>-l</tt> or <tt>--local</tt> specifies that the variables will be made local.
+The following options are available:
+
+- <tt>-c CMD</tt> or <tt>--command=CMD</tt> sets the initial string in the interactive mode command buffer to <tt>CMD</tt>.
+- <tt>-g</tt> or <tt>--global</tt> makes the variables global (default behaviour).
+- <tt>-l</tt> or <tt>--local</tt> makes the variables local.
- <tt>-m NAME</tt> or <tt>--mode-name=NAME</tt> specifies that the name NAME should be used to save/load the history file. If NAME is fish, the regular fish history will be available.
-- <tt>-p PROMPT_CMD</tt> or <tt>--prompt=PROMPT_CMD</tt> 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 <tt>set_color green; echo read; set_color normal; echo "> "</tt>.
-- <code>-s</code> or <code>--shell</code> Use syntax highlighting, tab completions and command termination suitable for entering shellscript code
-- <code>-u</code> or <code>--unexport</code> causes the specified environment not to be exported to child processes
-- <code>-U</code> or <code>--universal</code> causes the specified environment variable to be made universal. If this option is supplied, the variable will be shared between all the current users fish instances on the current computer, and will be preserved across restarts of the shell.
-- <code>-x</code> or <code>--export</code> causes the specified environment variable to be exported to child processes
-
-Read starts by reading a single line of input from stdin, the line is
-then tokenized using the <tt>IFS</tt> environment variable. Each variable
-specified in <tt>VARIABLES</tt> is then assigned one tokenized string
-element. If there are more tokens than variables, the complete
-remainder is assigned to the last variable.
+- <tt>-p PROMPT_CMD</tt> or <tt>--prompt=PROMPT_CMD</tt> uses the output of the shell command \c PROMPT_CMD as the prompt for the interactive mode. The default prompt command is <tt>set_color green; echo read; set_color normal; echo "> "</tt>.
+- <code>-s</code> or <code>--shell</code> enables syntax highlighting, tab completions and command termination suitable for entering shellscript code in the interactive mode.
+- <code>-u</code> or <code>--unexport</code> prevents the variables from being exported to child processes (default behaviour).
+- <code>-U</code> or <code>--universal</code> causes the specified environment variable to be made universal.
+- <code>-x</code> or <code>--export</code> exports the variables to child processes.
+
+\c read reads a single line of input from stdin, breaks it into tokens
+based on the <tt>IFS</tt> environment variable, and then assigns one
+token to each variable specified in <tt>VARIABLES</tt>. If there are more
+tokens than variables, the complete remainder is assigned to the last variable.
\subsection read-example Example
-<tt>echo hello|read foo</tt>
+The following code stores the value 'hello' in the environment variable
+<tt>$foo</tt>.
-Will cause the variable \$foo to be assigned the value hello.
+<tt>echo hello|read foo</tt>