This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: default shell
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Dawid Ferenczy <ferenczy at volny dot cz>, cygwin at cygwin dot com
- Date: Sat, 26 Apr 2014 03:09:34 +0400
- Subject: Re: default shell
- Authentication-results: sourceware.org; auth=none
- References: <loom dot 20140424T185221-299 at post dot gmane dot org>
- Reply-to: cygwin at cygwin dot com
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