default shell

Andrey Repin anrdaemon@yandex.ru
Fri Apr 25 23:35:00 GMT 2014


Greetings, Dawid Ferenczy!

>    it's not a big deal, I just wonder what to execute, if I would like to
> execute user's default shell (defined in /etc/passwd). For example in cmd.exe, 
> ConEmu or Console2. I don't want to hardcode a shell anywhere (in console 
> emulator configuration, some batch file etc.), I just want to auto detect 
> user's default shell and execute it. If it's possible :) Exactly the same what 
> does mintty.

The answer depends on what you actually trying to do.
Else, there's no simple answer. Default "default" shell is bash, but user can
pick any other, and mintty does some trickery to find it out.
You can try something like

USERSHELL=$( XXX=$( getent passwd $USER ) echo ${XXX##*:} )

but there's no easy equivalent for *NIX scripting in CMD, that does this.
Soo.... back to the original question. What you are trying to do, for what
mintty isn't sufficient?


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 26.04.2014, <03:00>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list