X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_PD,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4C811B56.3010401@redhat.com> Date: Fri, 03 Sep 2010 09:59:18 -0600 From: Eric Blake User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2 MIME-Version: 1.0 To: pmcferrin AT columbus DOT rr DOT com CC: Cygwin Subject: Re: How does one change the default shell? References: <4C802658 DOT 9090105 AT redhat DOT com> <4C802BB4 DOT 4000907 AT redhat DOT com> <4C8119D5 DOT 9070201 AT columbus DOT rr DOT com> In-Reply-To: <4C8119D5.9070201@columbus.rr.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 09/03/2010 09:52 AM, Paul McFerrin wrote: > > How about the obvious....Change the shell listed in the /etc/passwd file > for the affected user. I for years had pdksh as my default shell. Yes, I > was a long time AT&Ter, where the ksh was invented. Quit top-posting, and http://cygwin.com/acronyms/#YSHFRTT The OP already made it clear that changing /etc/password was not what he meant (that only changes your interactive shell), rather he was asking how to make /bin/sh be pdksh instead of bash (for all scripts, so that an arbitrary script ./foo can use pdksh features). If a shell script starts with a #! line, then that's the shell that will be used, regardless of the user's /etc/passwd shell or the current setting of $SHELL. And if a shell script does not start with a #! line, then it will be executed with /bin/sh, again regardless of /etc/passwd or $SHELL. So the only way to change the equation is to change /bin/sh, or to use an appropriate #! line in all affected scripts. Personally, I find #! the more robust option (just like I recommend that you should use #!/bin/bash if you intend on using a bash feature, rather than blindly relying on the fact that /bin/sh defaults to bash in cygwin). -- Eric Blake eblake AT redhat DOT com +1-801-349-2682 Libvirt virtualization library http://libvirt.org -- 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