Como posso verificar se um shell é login / interactive / batch in fish?

3

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 .

    
por Dan 23.04.2016 / 23:13

1 resposta

9

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.

    
por 23.04.2016 / 23:19