[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cygwin
Subject:    Re: default shell
From:       Andrey Repin <anrdaemon () yandex ! ru>
Date:       2014-04-25 23:09:34
Message-ID: 6959315.20140426030934 () yandex ! ru
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic