public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* pdksh package: Error when issuing a 'typeset -r' statement
@ 2008-05-14  2:54 Matthew Pettis
  2008-05-14  8:22 ` Mark J. Reed
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Pettis @ 2008-05-14  2:54 UTC (permalink / raw)
  To: cygwin

Hi,

Cygwin newbie, first time poster...

I installed cygwin with the 'pdksh' package.  When I try to run issue
anything like the following:

$ typeset -r x=1

I get the error:

pdksh: x: is read only

x has never been set, so this is not true (happens for any identifier,
even just after I start pdksh).

I've googled and searched the mailing list, and I haven't seen any
mention of this problem.

Any solutions/workarounds?

P.S.  - I also have a wierd propmt, as seen below... Haven't
researched that, as it is not critical, but if anyone knows offhand...

\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n$ typeset -r x=1

Thanks,
Matt
-- 
It is from the wellspring of our despair and the places that we are
broken that we come to repair the world.
-- Murray Waas

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pdksh package: Error when issuing a 'typeset -r' statement
  2008-05-14  2:54 pdksh package: Error when issuing a 'typeset -r' statement Matthew Pettis
@ 2008-05-14  8:22 ` Mark J. Reed
  2008-05-14 13:29   ` Mark J. Reed
  0 siblings, 1 reply; 6+ messages in thread
From: Mark J. Reed @ 2008-05-14  8:22 UTC (permalink / raw)
  To: cygwin

On Tue, May 13, 2008 at 9:33 PM, Matthew Pettis
<matthew.pettis@gmail.com> wrote:

>  I installed cygwin with the 'pdksh' package.  When I try to run issue
>  anything like the following:
>
>  $ typeset -r x=1
>
>  I get the error:
>
>  pdksh: x: is read only

This is a known 8+-year-old bug in pdksh, which as far as I can tell
is no longer being maintained by anyone (pointers to the contrary
welcome).  Why do you want pdksh?  Isn't Gen-u-wine ksh available for
Cygwin?

Anyway, it's setting the readonly flag (typeset -r) before
initializing the var instead of after.  Nothing to do with Cygwin -
you'll see the same error with pdksh 5.2.14 on NetBSD, OS X, Linux,
etc.  There's a patch that the Cygwin maintainer could apply to the
package, which fixes this and two other bugs:

http://www.cs.mun.ca/~michael/pdksh/files/pdksh-5.2.14-patches.1

There's also a patches.2; not sure what it fixes.  Note that the file
dates are bogus; the .1 patch dates back at least to November 2000.

>  P.S.  - I also have a weird prompt, as seen below... Haven't
>  researched that, as it is not critical, but if anyone knows offhand...
>
>  \[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n$

That's just a heavily bash-ified prompt as it appears in ksh; guess
the Cygwin shell init files set that up in a "profile" somewhere
instead of a "bash_profile".  Tsk.   Easiest fix is to just set PS1 to
something more ksh-friendly in your own .profile.
-- 
Mark J. Reed <markjreed@gmail.com>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pdksh package: Error when issuing a 'typeset -r' statement
  2008-05-14  8:22 ` Mark J. Reed
@ 2008-05-14 13:29   ` Mark J. Reed
  2008-05-15 15:00     ` phil long
  0 siblings, 1 reply; 6+ messages in thread
From: Mark J. Reed @ 2008-05-14 13:29 UTC (permalink / raw)
  To: cygwin

As a side note, I find modern bash to be a very suitable replacement
for ksh.   I switched years ago, and I was a heavy Korn Shell
user/programmer, a long-time holdout on learning this newfangled
"Perl" thing because the KornShell Command and Programming Language
was more than sufficient, thankyouverymuch.

It follows that my personal ksh environment was heavily customized, so
I had to modify it somewhat to make it bash-friendly (main culprits:
array syntax, unsupported typeset options, "print", "whence",
coprocesses.) It was worth the effort, IMO, since every OS comes with
bash these days, while ksh's price tag/license led to slower adoption
among open source OSes (and pdksh has never risen to the level of the
real thing).

I've been quite happy with bash overall, and it might suit your needs as well.

-- 
Mark J. Reed <markjreed@gmail.com>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pdksh package: Error when issuing a 'typeset -r' statement
  2008-05-14 13:29   ` Mark J. Reed
@ 2008-05-15 15:00     ` phil long
  2008-05-15 16:14       ` Mark J. Reed
  0 siblings, 1 reply; 6+ messages in thread
From: phil long @ 2008-05-15 15:00 UTC (permalink / raw)
  To: cygwin

Mark J. Reed <markjreed <at> mail.com> writes:

> 
> I had to modify it somewhat to make it bash-friendly (main culprits:
> array syntax, unsupported typeset options, "print", "whence",
> coprocesses.)
> 


What do U use to replace ksh coprocesses?



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pdksh package: Error when issuing a 'typeset -r' statement
  2008-05-15 15:00     ` phil long
@ 2008-05-15 16:14       ` Mark J. Reed
  0 siblings, 0 replies; 6+ messages in thread
From: Mark J. Reed @ 2008-05-15 16:14 UTC (permalink / raw)
  To: cygwin

I rearchitected the solution so I didn't need them. ;)  They're
something I used 'cause they were available, but I haven't found a
case yet where they were indispensible.



On 5/15/08, phil long <phillip.long@gossinternational.com> wrote:
> Mark J. Reed <markjreed <at> mail.com> writes:
>
>>
>> I had to modify it somewhat to make it bash-friendly (main culprits:
>> array syntax, unsupported typeset options, "print", "whence",
>> coprocesses.)
>>
>
>
> What do U use to replace ksh coprocesses?
>
>
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>

-- 
Sent from Gmail for mobile | mobile.google.com

Mark J. Reed <markjreed@gmail.com>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* pdksh package: Error when issuing a 'typeset -r' statement
@ 2008-05-14 21:48 Matthew Pettis
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew Pettis @ 2008-05-14 21:48 UTC (permalink / raw)
  To: cygwin; +Cc: markjreed

Hi Mark (Reed),

Sorry, I get digest forms, and I'm not sure how to respond to them so
this shows up as part of the thread.

I am a bash user for what I do, but need a ksh because I fixing some
scripts for someone who is running on pure ksh.  I'm connecting to a
PC in Europe, and cannot directly ssh to the server from my pc -- only
by opening a Remote Desktop Connection and launching putty from there
do I have access to the actual ksh system.  It's a slow connection, so
I wanted a local ksh emulator with which to test out some of my code
changes fast and easy for well-formedness without having to go over
the connection.

Normally, I do use bash, so this is a bit of a change for me.  I'll
check out and see if Gen-u-wine is available in Cygwin (I don't recall
it being under the 'Shell' grouping of packages).

Thanks for your help and thoughts,
Matt

-- 
It is from the wellspring of our despair and the places that we are
broken that we come to repair the world.
-- Murray Waas

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-05-15 15:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-14  2:54 pdksh package: Error when issuing a 'typeset -r' statement Matthew Pettis
2008-05-14  8:22 ` Mark J. Reed
2008-05-14 13:29   ` Mark J. Reed
2008-05-15 15:00     ` phil long
2008-05-15 16:14       ` Mark J. Reed
2008-05-14 21:48 Matthew Pettis

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