mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
parent
03431ae9a2
commit
1377f71331
4 changed files with 12 additions and 12 deletions
|
@ -29,9 +29,9 @@ The following options are available:
|
|||
- ``-n NCHARS`` or ``--nchars=NCHARS`` makes ``read`` return after reading NCHARS characters or the end of
|
||||
the line, whichever comes first.
|
||||
|
||||
- ``-p PROMPT_CMD`` or ``--prompt=PROMPT_CMD`` uses the output of the shell command ``PROMPT_CMD`` as the prompt for the interactive mode. The default prompt command is <code>set_color green; echo read; set_color normal; echo "> "</code>.
|
||||
- ``-p PROMPT_CMD`` or ``--prompt=PROMPT_CMD`` uses the output of the shell command ``PROMPT_CMD`` as the prompt for the interactive mode. The default prompt command is `set_color green; echo read; set_color normal; echo "> "`
|
||||
|
||||
- ``-P PROMPT_STR`` or ``--prompt-str=PROMPT_STR`` uses the string as the prompt for the interactive mode. It is equivalent to <code>echo PROMPT_STR</code> and is provided solely to avoid the need to frame the prompt as a command. All special characters in the string are automatically escaped before being passed to the <code>echo</code> command.
|
||||
- ``-P PROMPT_STR`` or ``--prompt-str=PROMPT_STR`` uses the string as the prompt for the interactive mode. It is equivalent to `echo PROMPT_STR` and is provided solely to avoid the need to frame the prompt as a command. All special characters in the string are automatically escaped before being passed to the `echo` command.
|
||||
|
||||
- ``-R RIGHT_PROMPT_CMD`` or ``--right-prompt=RIGHT_PROMPT_CMD`` uses the output of the shell command ``RIGHT_PROMPT_CMD`` as the right prompt for the interactive mode. There is no default right prompt command.
|
||||
|
||||
|
|
|
@ -314,7 +314,7 @@ Examples
|
|||
::
|
||||
|
||||
>_ echo \\x07 | string escape
|
||||
<bs>cg</bs>
|
||||
cg
|
||||
|
||||
|
||||
|
||||
|
@ -322,7 +322,7 @@ Examples
|
|||
::
|
||||
|
||||
>_ string escape --style=var 'a1 b2'\\u6161
|
||||
<bs>a1_20b2__c_E6_85_A1</bs>
|
||||
a1_20b2__c_E6_85_A1
|
||||
|
||||
|
||||
Match Glob Examples
|
||||
|
|
|
@ -113,7 +113,7 @@ Example::
|
|||
>ls -l | grep "my topic"
|
||||
|
||||
|
||||
- Commands can pass on all their output as a chunk</b>: the output stream of one command is bundled and taken as data argument for the second command. This is called command substitution, see `Command Substitution`_.
|
||||
- Commands can pass on all their output as a chunk: the output stream of one command is bundled and taken as data argument for the second command. This is called command substitution, see `Command Substitution`_.
|
||||
|
||||
Example::
|
||||
|
||||
|
@ -1003,7 +1003,7 @@ Shell variables
|
|||
|
||||
Shell variables are named pieces of data, which can be created, deleted and their values changed and used by the user. Variables may optionally be "exported", so that a copy of the variable is available to any subprocesses the shell creates. An exported variable is referred to as an "environment variable".
|
||||
|
||||
To set a variable value, use the `set <cmds/set.html>`_ command</a>. A variable name can not be empty and can contain only letters, digits, and underscores. It may begin and end with any of those characters.
|
||||
To set a variable value, use the :ref:`set <cmd-set>` command. A variable name can not be empty and can contain only letters, digits, and underscores. It may begin and end with any of those characters.
|
||||
|
||||
Example:
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ which means you are all set up and can start using fish::
|
|||
|
||||
> fish
|
||||
Welcome to fish, the friendly interactive shell
|
||||
Type <span class="cwd">help</span> for instructions on how to use fish
|
||||
Type help for instructions on how to use fish
|
||||
you@hostname ~>____
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ Learning fish
|
|||
|
||||
This tutorial assumes a basic understanding of command line shells and Unix commands, and that you have a working copy of ``fish``.
|
||||
|
||||
If you have a strong understanding of other shells, and want to know what ``fish`` does differently, search for the magic phrase <em>unlike other shells</em>, which is used to call out important differences.
|
||||
If you have a strong understanding of other shells, and want to know what ``fish`` does differently, search for the magic phrase *unlike other shells*, which is used to call out important differences.
|
||||
|
||||
|
||||
Running Commands
|
||||
|
@ -260,7 +260,7 @@ Unlike other shells, ``fish`` does not have an export command. Instead, a variab
|
|||
|
||||
>_ set -x MyVariable SomeValue
|
||||
>_ env | grep MyVariable
|
||||
<m>MyVariable=SomeValue</m>
|
||||
MyVariable=SomeValue
|
||||
|
||||
|
||||
You can erase a variable with ``-e`` or ``--erase``
|
||||
|
@ -370,7 +370,7 @@ A common idiom is to capture the output of a command in a variable::
|
|||
|
||||
Command substitutions are not expanded within quotes. Instead, you can temporarily close the quotes, add the command substitution, and reopen them, all in the same argument::
|
||||
|
||||
>_ touch <i class="quote">"testing_"</i>(date +%s)<i class="quote">".txt"</i>
|
||||
>_ touch "testing_"(date +%s)".txt"
|
||||
>_ ls *.txt
|
||||
testing_1360099791.txt
|
||||
|
||||
|
@ -531,7 +531,7 @@ Loops
|
|||
While loops::
|
||||
|
||||
>_ while true
|
||||
echo <i class="quote">"Loop forever"</i>
|
||||
echo "Loop forever"
|
||||
end
|
||||
Loop forever
|
||||
Loop forever
|
||||
|
@ -564,7 +564,7 @@ You can define your own prompt::
|
|||
>_ function fish_prompt
|
||||
echo "New Prompt % "
|
||||
end
|
||||
<asis>New Prompt % </asis>___
|
||||
New Prompt %
|
||||
|
||||
|
||||
Multiple lines are OK. Colors can be set via ``set_color``, passing it named ANSI colors, or hex RGB values::
|
||||
|
|
Loading…
Reference in a new issue