Re: How does one change the default shell?

2010-09-03 Thread Dave No, not /that/ one! Korn
On 02/09/2010 23:29, risin...@nationwide. wrote:
 I use pdksh as my login shell - I have been using the Korn shell (thanks 
 Dave!) 

  See From: header!

cheers,
  DaveK

--
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



Re: How does one change the default shell?

2010-09-03 Thread Eric Blake

On 09/03/2010 09:52 AM, Paul McFerrin wrote:


How about the obviousChange 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 ATTer, 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   ebl...@redhat.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



Re: How does one change the default shell?

2010-09-02 Thread Eric Blake

On 09/02/2010 04:29 PM, risin...@nationwide.com wrote:

I use pdksh as my login shell - I have been using the Korn shell (thanks
Dave!) since 1984 or so, so it is what I am used to and has features I
haven't been able to find in bash - at least not yet.  So to expedite
script writing, I use the ksh language and features  Every time that I
write a script, I have to remember to put in the shebang line
(#!/bin/pdksh) or half the time my scripts won't work.

Is there a way to change the default shell for cygwin?  I checked the user
guide and the FAQ, but no joy there.  I tried setting and exporting the
SHELL variable, but that did not work.


Assuming you meant the default shell for your particular user id, it is 
just a matter of changing cygwin.bat or whatever shortcut you are using 
to start cygwin to call pdksh instead of bash.  You can also edit 
/etc/passwd to set your preferred shell (some tools, like mintty, honor 
that setting).


--
Eric Blake   ebl...@redhat.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



Re: How does one change the default shell?

2010-09-02 Thread Eric Blake

On 09/02/2010 04:29 PM, risin...@nationwide.com wrote:

I use pdksh as my login shell - I have been using the Korn shell (thanks
Dave!) since 1984 or so, so it is what I am used to and has features I
haven't been able to find in bash - at least not yet.  So to expedite
script writing, I use the ksh language and features  Every time that I
write a script, I have to remember to put in the shebang line
(#!/bin/pdksh) or half the time my scripts won't work.


By the way, please don't commandeer threads.  Start a new thread for a 
new topic.


--
Eric Blake   ebl...@redhat.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



Re: How does one change the default shell?

2010-09-02 Thread RISINGP1
On 09/02/2010 04:29 PM, risin...@nationwide.com wrote:
 I use pdksh as my login shell - I have been using the Korn shell 
(thanks
 Dave!) since 1984 or so, so it is what I am used to and has features I
 haven't been able to find in bash - at least not yet.  So to expedite
 script writing, I use the ksh language and features  Every time that I
 write a script, I have to remember to put in the shebang line
 (#!/bin/pdksh) or half the time my scripts won't work.

 Is there a way to change the default shell for cygwin?  I checked the 
user
 guide and the FAQ, but no joy there.  I tried setting and exporting the
 SHELL variable, but that did not work.

Assuming you meant the default shell for your particular user id, it is 
just a matter of changing cygwin.bat or whatever shortcut you are using 
to start cygwin to call pdksh instead of bash.  You can also edit 
/etc/passwd to set your preferred shell (some tools, like mintty, honor 
that setting).

My /etc/passwd entry:

RISINGP1:unused_by_nt/2000/xp:287838:10545:RISINGP1,U-NWIE\RISINGP1,S-1-5-21-725345543-616249376-1177238915-277838:/cygdrive/c/cygwin/home/risingp1:/bin/pdksh

My cygwin.bat:

@echo off

C:
chdir C:\cygwin\bin

REM bash --login -i
REM pdksh -l -i
start mintty -p 70,0 -t Console -e -

This starts me off in pdksh, but when I execute a shell script, it runs 
under bash.

Any other ideas?

Thanks,

- Phil

P.S.
I did not realize I was commandeering the thread.  My apologies - it won't 
happen again.


--
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



Re: How does one change the default shell?

2010-09-02 Thread Eric Blake

On 09/02/2010 04:49 PM, risin...@nationwide.com wrote:

write a script, I have to remember to put in the shebang line
(#!/bin/pdksh) or half the time my scripts won't work.

Is there a way to change the default shell for cygwin?  I checked the

user

guide and the FAQ, but no joy there.  I tried setting and exporting the
SHELL variable, but that did not work.


Assuming you meant the default shell for your particular user id, it is
just a matter of changing cygwin.bat or whatever shortcut you are using
to start cygwin to call pdksh instead of bash.  You can also edit
/etc/passwd to set your preferred shell (some tools, like mintty, honor
that setting).


This starts me off in pdksh, but when I execute a shell script, it runs
under bash.


Ah, so you mean how to change /bin/sh to be pdksh instead of bash.  Simple:

cp /bin/{pdk,}sh

But be prepared to redo that every time you upgrade bash via setup.exe, 
and don't come crying to the list if things break that were expecting 
bash when they got pdksh.



I did not realize I was commandeering the thread.  My apologies - it won't
happen again.


Merely changing a Subject: line does not change the In-Reply-To: headers 
that form threading.


--
Eric Blake   ebl...@redhat.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



Re: How does one change the default shell?

2010-09-02 Thread RISINGP1
[ACK!  I just realized I was continuing my usurping of the thread. Sorry.]

On 09/02/2010 04:29 PM, risin...@nationwide.com wrote:
 I use pdksh as my login shell - I have been using the Korn shell 
(thanks
 Dave!) since 1984 or so, so it is what I am used to and has features I
 haven't been able to find in bash - at least not yet.  So to expedite
 script writing, I use the ksh language and features  Every time that I
 write a script, I have to remember to put in the shebang line
 (#!/bin/pdksh) or half the time my scripts won't work.

 Is there a way to change the default shell for cygwin?  I checked the 
user
 guide and the FAQ, but no joy there.  I tried setting and exporting the
 SHELL variable, but that did not work.

Assuming you meant the default shell for your particular user id, it is 
just a matter of changing cygwin.bat or whatever shortcut you are using 
to start cygwin to call pdksh instead of bash.  You can also edit 
/etc/passwd to set your preferred shell (some tools, like mintty, honor 
that setting).

My /etc/passwd entry:

RISINGP1:unused_by_nt/2000/xp:287838:10545:RISINGP1,U-NWIE\RISINGP1,S-1-5-21-725345543-616249376-1177238915-277838:/cygdrive/c/cygwin/home/risingp1:/bin/pdksh

My cygwin.bat:

@echo off

C:
chdir C:\cygwin\bin

REM bash --login -i
REM pdksh -l -i
start mintty -p 70,0 -t Console -e -

This starts me off in pdksh, but when I execute a shell script, it runs 
under bash.

Any other ideas?

Thanks,

- Phil

P.S.
I did not realize I was commandeering the thread.  My apologies - it won't 
happen again.


--
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



Re: How does one change the default shell?

2010-09-02 Thread RISINGP1
  Ah, so you mean how to change /bin/sh to be pdksh instead of bash. 
Simple:
 
  cp /bin/{pdk,}sh
 
  But be prepared to redo that every time you upgrade bash via 
setup.exe, 
  and don't come crying to the list if things break that were expecting 
  bash when they got pdksh.

Thanks.  I was hoping to effect the change environmentally - not 
have to change exe's.

Should I follow that route, no crying will ensue.

I will probably just continue using the shebang line for safety.

- Phil

--
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



Re: How does one change the default shell?

2010-09-02 Thread Andy Koppe
On 2 September 2010 23:49, RISINGP1 wrote:
 My cygwin.bat:

 @echo off

 C:
 chdir C:\cygwin\bin

 REM bash --login -i
 REM pdksh -l -i
 start mintty -p 70,0 -t Console -e -

Btw, you don't need cygwin.bat to start mintty; you can just put those
parameters into a shortcut (or copy the one in the start menu and edit
it):

Target: C:\cygwin\bin\mintty -p 70,0 -t Console -

That avoids a console window flashing up when starting it.

Andy

--
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