Back to Fish

fish_is_root_user - check if the current user is root¶

docs/docs/3.2/cmds/fish_is_root_user.html

latest720 B
Original Source

This documents an old version of fish. See the latest release.

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\_userdo\_something\_differentendend