Use o status
command :
$ fish -c 'status --is-interactive; and echo yes; or echo no'
no
$ status --is-interactive; and echo yes; or echo no
yes
Além disso, status --is-login
. Isso deve cobrir suas bases.
Eu quero poder verificar se um fish
shell está sendo executado no modo de logon, interativo ou em lote e esta questão apenas discute bash
.
Use o status
command :
$ fish -c 'status --is-interactive; and echo yes; or echo no'
no
$ status --is-interactive; and echo yes; or echo no
yes
Além disso, status --is-login
. Isso deve cobrir suas bases.