Difference between revisions of "Talk:Fish"

From ArchWiki
Jump to: navigation, search
m (Current state: rm closed discussion)
(Troubleshooting Section - Shebangs and a toor alternative: new section)
Line 1: Line 1:
 +
== Troubleshooting Section - Shebangs and a toor alternative ==
  
 +
In general I would concur that the shebangs are usually sufficient to ensure that most scripts run in the proper shell. And I run fish as my normal user and have run it as the root shell in the past. That being said not all scripts are properly written. In particular scripts with a #!/bin/sh have been known to contain bash specific syntax as most linux systems use bash in bourne compatability mode for /bin/sh (I think debian uses dash, and the BSDs still have bourne shell)
 +
 +
If someone is truely paranoid about a critical script being run they should of course run the default shell. But these methods seem hackish ways to keep the default shell and use fish. Why not go the old root/toor route and have two users with the same uid/gid different names and different shells. I actually run all of my root accounts like this with bash as root and fish as toor just in case something is broken and expecting bash.
 +
 +
To get a toor account that uses fish run:
 +
{{bc|# useradd -ou 0 -g 0 toor
 +
# passwd toor
 +
# chsh -s /usr/bin/fish toor
 +
}}
 +
And then instead of {{ic|su}} call {{ic|su toor}} and everything else is the same as root (even the prompts say root) you just have a different shell. I imagine that the same could be done with a regular user say 'johndoe' and a user 'johndoefish' that has a different default shell.
 +
 +
Not publishing this on the page without comment though as toor has been superceeded for most purposes but the concept seems transferable to the question at hand as the desire is to have one user with two shells.
 +
 +
[[User:Michorn|Michorn]] ([[User talk:Michorn|talk]]) 05:57, 6 November 2014 (UTC)

Revision as of 05:57, 6 November 2014

Troubleshooting Section - Shebangs and a toor alternative

In general I would concur that the shebangs are usually sufficient to ensure that most scripts run in the proper shell. And I run fish as my normal user and have run it as the root shell in the past. That being said not all scripts are properly written. In particular scripts with a #!/bin/sh have been known to contain bash specific syntax as most linux systems use bash in bourne compatability mode for /bin/sh (I think debian uses dash, and the BSDs still have bourne shell)

If someone is truely paranoid about a critical script being run they should of course run the default shell. But these methods seem hackish ways to keep the default shell and use fish. Why not go the old root/toor route and have two users with the same uid/gid different names and different shells. I actually run all of my root accounts like this with bash as root and fish as toor just in case something is broken and expecting bash.

To get a toor account that uses fish run:

# useradd -ou 0 -g 0 toor
# passwd toor
# chsh -s /usr/bin/fish toor

And then instead of su call su toor and everything else is the same as root (even the prompts say root) you just have a different shell. I imagine that the same could be done with a regular user say 'johndoe' and a user 'johndoefish' that has a different default shell.

Not publishing this on the page without comment though as toor has been superceeded for most purposes but the concept seems transferable to the question at hand as the desire is to have one user with two shells.

Michorn (talk) 05:57, 6 November 2014 (UTC)