manpagez: man pages & more
man read(1)
Home | html | info | man
read(1)                              fish                              read(1)




NAME

       read - read line of input into variables


   Synopsis
       read [OPTIONS] [VARIABLES...]

   Description
       The read builtin causes fish to read one line from standard input and
       store the result in one or more environment variables.


       o -c CMD or --command=CMD specifies that the initial string in the
         interactive mode command buffer should be CMD.

       o -e or --export specifies that the variables will be exported to
         subshells.

       o -g or --global specifies that the variables will be made global.

       o -m NAME or --mode-name=NAME 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.

       o -p PROMPT_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 '> '.

       o -s or --shell Use syntax highlighting, tab completions and command
         termination suitable for entering shellscript code

       o -u or --unexport causes the specified environment not to be exported
         to child processes

       o -U or --universal 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.

       o -x or --export 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 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.

   Example
       echo hello|read foo

       Will cause the variable $foo to be assigned the value hello.



Version 1.23.1                    8 Mar 2009                           read(1)

fish 1.23.1 - Generated Sun Mar 8 14:16:01 CDT 2009
© manpagez.com 2000-2025
Individual documents may contain additional copyright information.