mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-07 10:38:47 +00:00
32 lines
531 B
ReStructuredText
32 lines
531 B
ReStructuredText
|
.. _cmd-fg:
|
||
|
|
||
|
fish_is_root_user - check if the current user is root
|
||
|
=====================================================
|
||
|
|
||
|
Synopsis
|
||
|
--------
|
||
|
|
||
|
::
|
||
|
|
||
|
fish_is_root_user
|
||
|
|
||
|
Description
|
||
|
-----------
|
||
|
|
||
|
``fish_is_root_user`` will check if the current user is root. It can be useful
|
||
|
for the prompt to display something different if the user is root, for example.
|
||
|
|
||
|
|
||
|
Example
|
||
|
-------
|
||
|
|
||
|
A simple example:
|
||
|
|
||
|
::
|
||
|
|
||
|
function example --description 'Just an example'
|
||
|
if fish_is_root_user
|
||
|
do_something_different
|
||
|
end
|
||
|
end
|