public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: Dawid Ferenczy <ferenczy@volny.cz>, cygwin@cygwin.com
Subject: Re: default shell
Date: Fri, 25 Apr 2014 23:35:00 -0000	[thread overview]
Message-ID: <6959315.20140426030934@yandex.ru> (raw)
In-Reply-To: <loom.20140424T185221-299@post.gmane.org>

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

  reply	other threads:[~2014-04-25 23:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24 17:01 Dawid Ferenczy
2014-04-25 23:35 ` Andrey Repin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-03-15 16:08 Default shell Stein M. Eliassen
2001-03-16  5:25 ` Earnie Boyd
2001-03-16  6:57   ` Stein M. Eliassen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6959315.20140426030934@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    --cc=ferenczy@volny.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).