mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 05:43:11 +00:00
af61ea1325
We are using only :: in a synopsis for fishscript examples given of the command being documented.
36 lines
947 B
ReStructuredText
36 lines
947 B
ReStructuredText
.. _cmd-fish_greeting:
|
|
|
|
fish_greeting - display a welcome message in interactive shells
|
|
===============================================================
|
|
|
|
Synopsis
|
|
--------
|
|
|
|
**fish_greeting**
|
|
::
|
|
|
|
function fish_greeting
|
|
...
|
|
end
|
|
|
|
|
|
Description
|
|
-----------
|
|
|
|
When an interactive fish starts, it executes fish_greeting and displays its output.
|
|
|
|
The default fish_greeting is a function that prints a variable of the same name (``$fish_greeting``), so you can also just change that if you just want to change the text.
|
|
|
|
While you could also just put ``echo`` calls into config.fish, fish_greeting takes care of only being used in interactive shells, so it won't be used e.g. with ``scp`` (which executes a shell), which prevents some errors.
|
|
|
|
Example
|
|
-------
|
|
|
|
A simple greeting:
|
|
|
|
::
|
|
|
|
function fish_greeting
|
|
echo Hello friend!
|
|
echo The time is (set_color yellow; date +%T; set_color normal) and this machine is called $hostname
|
|
end
|