Slashdot Mirror


Ask David Korn About ksh And More

David Korn is the author of the famous Korn shell, ksh, which deserves consideration next to the ubiquitous bash. Quote (regarding the AT&T research group he's part of): "We don't write anything in Perl anymore, because [ksh93] has all the functionality built in." He's also an AT&T fellow, and heads up the UWIN project, which "provides a mechanism for building and running UNIX applications on Windows NT, Windows 98, and Windows 95 with few, if any, changes necessary." This is the software that allowed some crazy folks to run GNOME on Windows several weeks back as well. (And is available for no-cost personal use.) This is the same David Korn you may remember from this picture. I met him at a recent NYLUG meeting when he spoke about the Advanced Software Technologies collection of tools, now Open Source, and he graciously agreed to field questions in the usual Slashdot interview style. So please leave your questions in the space below --1 question per comment, please -- and Korn will get back to you with answers in the near future.

144 comments

  1. pdksh... by mirko · · Score: 3

    Do you collaborate (or plan to) with the pdksh development team ?
    --

    --
    Trolling using another account since 2005.
    1. Re:pdksh... by Dom2 · · Score: 1

      I very much doubt that this would be the case, given that the pdksh team are aiming at a version that is 13 years old. :-)

  2. Re:Question by ocelotbob · · Score: 1

    It's already been done. Do a search for "Korn shell" and Windows in your favorite search engine and you'll find dozens of KSH compliant shells for windows. KSH is the official shell of the POSIX standard so you want posix, you need korn.

    --

    Marxism is the opiate of dumbasses

  3. korn by Anonymous Coward · · Score: 1

    How does it make you feel that a shitty rapcore band is using your name?

  4. Re:[OT]Re:Comparison by ethereal · · Score: 1

    Thanks, man - you rock! I agree, ksh is one of the best-thought-out command-line shells. I'll try this stuff on bash tonight, it works on ksh.

    --

    Your right to not believe: Americans United for Separation of Church and

  5. Ksh and regexes by Luke · · Score: 2

    I'm currently using version M 1993-12-28 j on a FreeBSD 4.2-RELEASE system, compiled from the sources available at AT&T.

    My question is about ksh's regex capabilities. You mention that you don't have a need for Perl anymore due to expanded features in ksh. I have found the only area in which ksh seems to need improvement is in it's regular expression syntax, which differs greatly than the "norm" (if there is such a thing) in the UNIX world.

    Are there any plans to move towards a more POSIX-style for regular expressions, like those found in grep and Perl?

  6. Re:Question by UnknownSoldier · · Score: 1

    > The problem is that both are designed with large numbers of synchronous interfaces. Windoze has an excuse in that it is based on W3.1 where everything was synchronous,

    NT 3.51 (I believe) batched GDI requests up, to prevent the heavy performance of user mode->kernal mode switch.

  7. Re:Two simple questions... by cduffy · · Score: 2

    Hmm...

    IMHO, Unix is fluid enough not to be holding up progress. Most of your modern Unices have a plethora of features and hooks which wouldn't be found earlier, particularly in userspace. While some completely new paradigms exist (such as exokernels), even these can (via userspace libraries) be made to expose a Unixlike interface to applications.

    Consider, for instance, the relatively recent introduction of threading (both userspace and kernelspace); checkpoints (in userspace); component object models (userspace); ACLs (both); etc.

    While there most certainly are revolutionary ideas out there (hence Plan 9 and The HURD), these can still be edged into "unixlike" operating systems, retaining application compatibility and decreasing the amount of retraining necessary on transition. However, they will be even less "your father's Unix".

    I'm not current on OS research -- so take this with a grain of salt -- but I expect that Unixlike OSes will be around for quite some, even if they lose much of the appearance and limitations of the original. Improvement, that is to say, will be incremental rather than revolutionary. 'Twill still happen, though.

  8. Re:Why Only Unix/Linux? by UnknownSoldier · · Score: 1

    > Do you have any thoughts about why the shell concept has not caught on with other operating systems? I'm thinking of NT and Win2K in particular,

    Guess you have never heard of 4NT and 4DOS (Sorry for sounding like a commercial, but I've was using 4DOS since MSDOS ver 5, as a command.com replacement and NEVER had any problems! Games, Qemm, etc all worked perfectly back then. (History Trivia: Norton Utilities licensed a version and called it NDOS)

    I stopped using 4DOS about 3 years ago, when I switched over WinNT 4, and found 4NT.

    4NT does file-name completion better then any shell I have seen. Everytime I hit tab, it completes the NEXT filename to match. Shift-Tab does the previous match.

    i.e. directory
    abc
    ade
    adz
    foo

    I press tab and it puts the first filename on the command line. I press it again, it cycles to "ade", pressing again "adz", and pressing once more, puts "foo".
    If I start with "ad", then press tab it complets "ade" (like bash), I press tab once more, and it goes to the next match, "adz"

    Can BASH / KORN be configured this way ?

    P.S.
    Filename completion IS in the default shell "cmd" of Win NT4 and Win NT5 except the idiots at M$ DISABLED it by default! Search the registry for "CompletionChar" and set it's DWORD value to 9 (which is the TAB key)

  9. Re:Standard UNIX shell... cough by Shadowlion · · Score: 1

    Strange assertion - bash 'seeming' to be the standard UNIX shell. Since it isn't available by default on many (or is that any?) commercial UNICEs.

    My bad. :(

    I think I interpreted the line in one of my Bash tutorials that said something like, "Bash is available on my Unices, and is the default on some of them" to be, "Bash is the default on many of the available Unices."

    So it may be fair to reflect on what is missing from ksh that is in bash - things like PROMPT_COMMAND for a start.

    I think the question is still valid, my misinformed comments notwithstanding. If Bash is a superset of features from ksh, then what still makes ksh an appealing shell to use? What distingishes ksh from other shells that have similar features and/or functionality?


    --

  10. Re:Why? by lpontiac · · Score: 2
    Its flamebait because you were starting an OS war thread instead of discussing Korn shell issues.

    The title of the article is Ask David Korn About ksh And More . Korn has a lot of experience with the internals of both, and trying to get the different philosophies to cooperate with each other under one OS. Seems like a fair question directed to the perfect person...

  11. the ubiquitous bash shell? by sqlgeek · · Score: 1
    I realize that this is a mightily pro-Linux sight, but I still can't see refering to the bash shell as ubiquitous. In fact, outside of Linux I've never seen it as the default shell, and don't necessarily even see it installed. In Solaris, HPUX, AIX and such the ksh or csh are certainly the standards.

    My 2 cents.

    Scott

    1. Re:the ubiquitous bash shell? by double_h · · Score: 2

      For what it's worth (and I know this is common knowledge, but I'm mentioning in it hopes of limiting the number of redundant posts in this thread...): the reason that csh/ksh ship with commercial Unices and bash ships with Linux is because csh/ksh were originally written as non-free software. The need for a free, full-featured shell led to the development of bash, as well as free workalikes of the other shells (pdksh and tcsh) for those who needed to maintain close compatibility with existing ksh/csh scripts. (although scripting in csh is a bad idea from both a security and code maintainance point of view...)

      Personally, I've stuck with bash ever since I first used it, because it combines the best features of ksh (job control, history, aliasing/substitution) along with invaluable interactive features like tab completion and emacs-style editing keystrokes. If I need to write scripts, I'll either make it Bourne-shell compatible (so it will run anywhere) or else write it in Perl (where I'm much more comfortable with the syntax).

      But even though I haven't really used Mr. Korn's shell for about five years, I'm most appreciative of the advances he's made that have benefited programmers and admins everywhere. Good work!

    2. Re:the ubiquitous bash shell? by Dom2 · · Score: 1

      It comes with Solaris 8, but that's a very recent addition. Mind you, Solaris 8 also comes with zsh, which knocks bash into a cocked hat!

      -Dom

  12. Re:Why Only Unix/Linux? by vherva · · Score: 1
    4NT does file-name completion better then any shell I have seen. Everytime I hit tab, it completes the NEXT filename to match. Shift-Tab does the previous match.

    Of course zsh does that!

    setopt automenu

    (I think bash does as well.) Believe me: zsh (and bash) is much more powerful than 4NT. I use both on NT (zsh under cygwin). When I moved from DOS/4dos to unix I just couldn't believe what zsh was capable of.

    --
    -- v --
  13. Graphical dtksh, zend, standardizing on ksh93, rpm by emil · · Score: 3
    1. Since the code to Motif is now free and open, is there any possiblity that dtksh, the ksh93-compliant CDE shell with Motif extensions will be open-sourced? Novel wrote it; will they give it away?
    2. Any possibility that you could leverage Zend from php? Or what would it take to implement a dbi-like SQL layer for ksh?
    3. Under Solaris and HP-UX, ksh88 is installed in /usr/bin/ksh, ksh93 is installed in /usr/dt/bin/dtksh, but the default shell is the "Posix" shell, a superset of ksh. Is there any hope of getting this mess straigtened out?
    4. Will I ever expect Red Hat to include an RPM for ksh93? Or would you consider merging with Bash?
  14. ksh v. zsh by room101 · · Score: 1

    First of all: you're one of my heroes. Now my question: Do you feel like that ksh really has a future as far as the development of it? I've always thought that zsh is ksh on LSD or something. Do you feel like there is anything "new" to do with it? or has bash and zsh, etc done it all?

    --
    room101 -- how much can you stand before they break you?
    (they always break you eventually)
  15. Good Q, more detail by ragnar · · Score: 2
    Darn... you took my question already. ;) If I may clarify a little, a friend of mine told me this story and I'm really interested to know how true it is:

    Microsoft was doing a presentation about the upcoming features of Windows NT 5.0 and the presenter enthusiastically told about how the DOS shell was borrowing many features from ksh. He went on to explain this features and someone in the crowd tried to get the presenter's question. The individual asked a few pointed and technical questions, hinting as some doubt if MS could do what they planned. The presenter "pooh-poohed" the questioner and basically told him the MS engineers would work out the details and that the questioner had nothing to worry about.

    At this point, another person stood up and proclaimed, "Do you know that he is David Korn?"

    Anyhow, this is the version I know of, and I found the story to be a riot. It is probably off base, but a little more clear than the original poster's description. I'm *really* curious to know how much of this is true.

    --
    -- Solaris Central - http://w
  16. "Unix-like"? by yerricde · · Score: 2

    According to The Open Group, there is no such thing as a "UNIX-like" system. I personally use the term "nixclones" for GNU systems (GNU/Linux, Cygwin) and BSD systems. Or is that also a trademark abuse?
    Like Tetris? Like drugs? Ever try combining them?

    --
    Will I retire or break 10K?
  17. Re:Comparison by tchuladdiass · · Score: 2
    Actually, that brings one of the main features that works in ksh but not in bash or pdksh, which is:

    some_command |read varname

    For whatever reason, varname is never set in bash or pdksh. What makes this particular operation so difficult? Do most shells execute the read after pipe in a sub process?

  18. Re:Comparison: ksh has "cd fromdir todir" by splante · · Score: 1

    One feature I miss in bash that's in ksh is
    cd from to

    It works like this: suppose you're in a directory
    /home/splante/ec/src/com/insightsys/ede/abcd
    but you have a parallel directory structure to
    'src' called 'test' and you want to cd to the same
    dir there--i.e. to:
    /home/splante/ec/test/com/insightsys/ede/abcd

    In ksh you just type:
    cd src test </blockquote>
    and it takes you there, printing the full directory you are now in.

    I find this a hard feature to live without, so I have this in my .bash_profile when I use bash:

    function cd()
    {
    #there are options on cd in bash2
    cdopts=""
    while [ "$1" != "${1#-}" ]
    do
    cdopts="${cdopts} ${1}"
    shift
    done

    if [ $# -eq 2 ]
    then
    pre=${PWD%%$1*}
    [ "$pre" = "$PWD" ] && { echo "cd: bad substution"; return 1; }
    post=${PWD#*$1}
    newdir="${pre}${2}${post}"
    [ -d "${newdir}" ] || { echo "cd: ${newdir}: no such directory";return 1;}
    echo "${newdir}"
    #echo builtin cd $cdopts "${newdir}"
    builtin cd $cdopts "${newdir}"
    else
    # echo builtin cd $cdopts "$@"
    builtin cd $cdopts "$@"
    fi
    }

    With this, bash can do it too. Of course, I have
    to copy it onto every system where I use bash
    (mostly Linux).

    Bash has some nice things too, though.

  19. Re:Why? by SquadBoy · · Score: 1

    You may be right about having to be logged in.But if you could tell me how to get a Windows box (any flavor) installed without the GUI or to boot to a console from which I can do almost anything I want and then only start the GUI when I want it please let me know. Why should my disk space have to be used for a ever growing swap file when most other OSes happily use a partition that the usage of grows and shrinks as needed. You know a why to roll your own kernel under Windows? I would really like to have this information. Granted I can not install sound drivers but the support for it in the kernel is still there (sound might be a bad example) but the point is I can not configure my own kernel. I'll grant that sometimes support for long file names work but I can not everytime cd to a directory with lonf filenames without resorting to the 8+3 hack. I know many people who have the same issue. Does not work right even with a hosts file, try it.

    --

    Cypherpunks: Civil Liberty Through Complex Mathematics. Those who live by the sword die by the arrow.
  20. Re:Question by -x- · · Score: 1

    I don't know about "world's best GUI"...and KSH is inherently CLI-oriented (and thus, not much related to whatever GUI you want to use). However, Mortice Kern Systems has been selling various incarnations of its "MKS Toolkit" since the mid-80's. I've been using their Korn-Shell as my preferred CLI under MS-DOS for over 15 years. Their version for Windows/NT is pretty good, too.

  21. Re:Ksh Programming For the Web by segmond · · Score: 2

    I hate to say this, but none of the shells are okay for web programming. Never forget this, "use the right tool for the job to be done.", just because one loves assembly programming doesn't mean it should be used for webprogramming. strong interpretted/scripted programming languages like perl/python/php are what you should look at. If ksh was fixed up to be good enough for webprograming, someone will soon request for a database library! yeah, for a shell...

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  22. Slashdot subject length is limited. by Chandon+Seldon · · Score: 1

    There is a length limit on the "Subject" field of Slashdot posts. If the poster had attempted to use the subject you suggest, he would have been stuck with the following:

    What functionality or code in ksh are you least pr
    --
    -- The act of censorship is always worse than whatever is being censored. Always.
  23. Yeah this has been bugging me... by AntiPasto · · Score: 1
    How do you prepare ksh? I was trying to fry some up the other day and I think I added too much paprika. It tasted, ya know, so-so so I added butter. Well then hell things really got bad. I couldn't tell my ksh from by bash. It all tastes like csh.

    ----

  24. Re:What functionality/code in ksh r u least proud by use_preview · · Score: 1
    What functionality or code in ksh are you least proud of, Sir?

    Where is the Grammar Nazi when you need him?

  25. Re: VI or Emacs? by -x- · · Score: 1

    I'm still partial to 'ed'. Quick, easy (since I learned all it's commands before vi was invented), and lightweight. Also, despite claims to the contrary, the command-line mode in vi *cannot* do everything that ed can - multiline commands, for example.

  26. Why are Bell Labs shells named after main programm by transact · · Score: 1

    Why have the Bell Labs originated shells, Mashey, Bourne and Korn been named after their main programmers? Other than awk programmer names don't show up in the names of programs developed at Bell Labs. Other shells developed outside Bell Labs tend to be named after some design goal.

  27. Re:Two simple questions... by sconeu · · Score: 2

    Moderators:

    Moderate this guy up!!!!

    --
    General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
  28. AST libraries by Digital+Commando · · Score: 1

    With Kiem Phong Vo and others, you have espoused a number of library design principles (e.g., use of (stackable) disciplines and proper exception handling) and used them to great effect in sfio and other libraries. Sfio, in particular, is just so much better than stdio that every time I use the latter I cringe.

    Unfortunately, these libraries seem to have not been widely adopted by the free software community since they were opened. (Perl can use sfio; other examples?) What do you think is needed to change that? Licensing? Perhaps distribution in the base packages of the free operating system distros? More documentation/tutorials/examples? These packages have their own auto-configuration feature test tool (iffe) and build scripts that differ in the details from the "./configure ; make ; make install" procedure common to much free software. Would it be helpful to convert them to use autoconf, for example?

    It seems a terrible shame that more programmers are not exposed to the library construction and reuse principles in Sfio, Cdt, Vmalloc. If these libraries were in everyday use, we'd probably see more code written in that style.

  29. Re:Ksh Programming For the Web by -x- · · Score: 1

    Actually...

    I have a suite of scripts and functions that I recently implemented to handle MS-SQL Server/7 from KSH. I currently do quite a bit of automated database processing from KSH.

    I've just finished a (less satisfactory) package for dealing with Oracle, too.

  30. Alternative shells on Windows systems by yerricde · · Score: 2

    Do you have any thoughts about why the shell concept has not caught on with other operating systems?

    Probably because Mac OS and Windows are designed around an assumption that newbies are very afraid of a command line.

    I'm thinking of NT and Win2K in particular, but it seems to be true in general.

    Bash and Fileutils have been ported to DOS (you'll need at least bsh204b.zip, fil316.zip, and txt20b.zip to get a useful shell). So has a lot of other GNU software; start with DJGPP, the DOS port of GCC.

    Install Red Hat Cygwin and you get Bash, GCC, and other things you may be used to on GNU/Linux, BSD, or UNIX systems.


    Like Tetris? Like drugs? Ever try combining them?
    --
    Will I retire or break 10K?
    1. Re:Alternative shells on Windows systems by Nailer · · Score: 2

      Probably because Mac OS and Windows are designed around an assumption that newbies are very afraid of a command line.

      Um, in case you haven't watched 99% of computer users rcently, I might remind you that that's a competely correct assumption to make. Any efficiancies gained from the command line batch processing are immediately lost when you consider the time taken to learnt to perform such functions. Rather than understand hwo to manipulate a series of around thirty of so widgets, the user must understand hundreds of commands, their relation to each otehr, and their various paramets, which are generally non-standardized across most Unixes.

      Just making a small point to remind y`all that GUIs remain the best interface for the majority of computer users - just as common cars [rather than custom hotrods] remain trhe best type of vehicle for drivers. Because most drivers aren't mechanics.

      Maybe that might prompt one the the GUI filemanagers to be capable of recursively changing permissions.

      On the topic of Windows command line interfaces, while extremely limited compared to Unix, tab completion in W2K for directories with spaces in them works much better than most Unix shells. In Unix spaces can be escaped with backslashes or quotes. But the default tab expansion uses backslashes - which makes the directory much less readable and [if there are more than two spaces, quite common for many word processed documents] often expans the filename way off screen.

      The windows cd can also do some nifty tricks. If you cd to a directory with a space in it and do not escape the name [Eg, `cd Program Files'] it will look at the unknown parameter `files' see if any directory called "Program Files" exist, and change into them accordingly. You can also use `cd ...' to ascend 2 directories, `cd ....' to go up three, etc.

  31. Re:Bash is a clone of ksh by gowen · · Score: 1
    I'm not *that* young and have been using unix since before Linux 1.0, so I'll tell you why I run out and install "bash" to replace ksh - Reverse ISearch. Ksh has its own version (which resembles many other CLI's like matlab) but readline's implementation is just more usable. Thats it.

    I still script in ksh, no point in being a bigot about it.

    --
    Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
  32. or dtksh? by devphil · · Score: 2

    IIRC, there's also a dtksh, in which all of the CDE controlling scripts are written. It seems to be ksh with some GUI-ish stuff built in (kinda like Tk).

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  33. Re:Why Only Unix/Linux? by UnknownSoldier · · Score: 1

    > zsh (and bash) is much more powerful than 4NT.

    Yeap, I know. I just got used to the 4NT %@ commands and have a hard time converting over to another shell.

    Got a link for zsh? That shells sounds kind of interesting.

  34. Re:Comparison by Splatta · · Score: 1

    csh is NOT the default shell in Solaris, sh is.

  35. Side note: GCC no longer on UWIN by devphil · · Score: 2


    This doesn't have anything to do with the ultra-cool ksh, but I'd thought I'd mention it: this message is the announcement of removal of support for GCC running under UWIN. This decision came direct from RMS and generated lots of discussion over the next several days concerning legal-but-not-political decisions.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  36. Re:Comparison by larien · · Score: 2
    Ahem:
    jr:merlin% pkginfo | grep bash
    system SUNWbash GNU Bourne-Again shell (bash)
    jr:merlin% uname -a
    SunOS merlin.scms.rgu.ac.uk 5.8 Generic sun4u sparc SUNW,Ultra-1
    Bash is shipped in Solaris 8, along with zsh (my personal favourite) and some other open source goodies.
    --
  37. There is a lot more to the size than you realize. by emil · · Score: 2

    On my Solaris x86 system, here are the sizes for some of the ksh-type shells:

    -r-xr-xr-x 2 root root 215304 Jan 5 2000 /sbin/sh
    -r-xr-xr-x 3 root bin 167168 Jan 11 00:04 /usr/bin/ksh
    -r-xr-xr-x 1 bin bin 651888 Dec 2 1999 /usr/dt/bin/dtksh

    But wait, ksh93 (which is sort of dtksh) supports libraries loaded at run time, so the size can be deceptive.

    I've heard that sash is much more appropriate for a linux-floppy environment.

  38. Re:[OT]Re:Comparison by Sabalon · · Score: 2

    AFAIK it's just there. I've believe that both tab and esc-esc work for it. I know what you mean about the HP-UX thing - ll everywhere :)

  39. Uwin vs .NET by Alien54 · · Score: 2
    How do you address the ever changing future of the microsoft product line, as far as UWin is concerned?

    [For example, MS .NET probably is not going to let you host your stuff there, even if you wanted . . .]

    Given the variety of problems MS has had with their servers over the past few days, what is your opinion of the future/workability of that approach compared to your own?

    --
    "It is a greater offense to steal men's labor, than their clothes"
  40. Why Only Unix/Linux? by north.coaster · · Score: 4

    The "shell" has been a key feature of Unix/Linux for over twenty years. The concept of having the freedom to use a different shell is clearly popular and important among users. Do you have any thoughts about why the shell concept has not caught on with other operating systems? I'm thinking of NT and Win2K in particular, but it seems to be true in general.

    north.coaster

    1. Re:Why Only Unix/Linux? by chrischow · · Score: 1

      Mac OS X is a "unix-like" OS

    2. Re:Why Only Unix/Linux? by -x- · · Score: 1

      I, for one, have been using the Mortice Kern System's kornshell and UNIX-style utilities (MKS Toolkit) on MS-DOS, and now Windows/NT, since the mid-80's. The Korn-Shell is definitely my CLI of choice, and one of the best scripting languages I've encountered. Interestingly enough, when Microsoft still sold Xenix (as part of its attempt to fragment the UNIX community, I think), the best shell for it was also produced by MKS. Xenix didn't ship with a Korn-Shell, just a Bourne-Shell and C-Shell. I started out with the Bourne Shell under UNIX v6, and loved it. The Korn shell is, IMHO, just a (significantly) improved Bourne shell.

    3. Re:Why Only Unix/Linux? by KnightStalker · · Score: 1

      Before I had ever used any OS on the PC but MS-DOG, and all I used my XT for was dialing up Fidonet BBSes at 1200 baud with QModem and reading QWK mail with SLiMeR, I considered a system unusable if JPSoft's 4DOS wasn't installed to replace DOS 3.3's command.com. NDOS was also acceptable.

      I vaguely remember a 4OS2 shell as well, and I know they've released 4NT.

      There are also replacements for Windows Explorer, such as LiteStep. There were replacements (most of them sucked) for progman.exe.

      Anyway, my point is that it may not be as popular as it is in the unix world, but you certainly do have the freedom to change the default shell under M$ OSes, and you always have.

      --
      * And remember, it's spelled N-e-t-s-c-a-p-e, but it's pronounced "Mozilla."
    4. Re:Why Only Unix/Linux? by vherva · · Score: 1
      Somewhat surprisingly, this works: http://www.zsh.org.

      I think you may get lucky with google or freshmeat as well...

      --
      -- v --
  41. Have you ever thought about... by Fleet+Admiral+Ackbar · · Score: 1

    doing a 'bash-mode', where those of us who prefer bash on the command line would be able to have easy bash-style commands, while still retaining the ksh scripting features?

    --
    Carefree highway, let me slip away on you.
  42. Bash is a clone of ksh by PhotoGuy · · Score: 2
    Come on kiddies, you're showing your youth :-) ksh existed long before bash.

    "bash is the default shell on Unix?" On Linux, yes, on Unix, no.

    Most of the cool bash-isms (such vi and emacs editing modes) were straight from ksh. Bash was a free clone of ksh, with a bunch of other stuff thrown in.

    I get a bit of a kick out of these Unix youngers, forced to use Solaris, run out and install bash, not realizing /bin/ksh does most of the same thing. (The main reason that Unix youngers will just plain not use ksh, is lack of arrow key support. But no *real* Unix user would think of using arrow keys. Why not just find a "notepad" and Windows Explorer clone, or go back to Windows :-)

    bash is to ksh as Linux is to Unix. A newer, cooler, free version of an great thing.

    -me-

    --
    Love many, trust a few, do harm to none.
    1. Re:Bash is a clone of ksh by Tackhead · · Score: 2
      >The main reason that Unix youngers will just plain not use ksh, is lack of arrow key support. But no *real* Unix user would think of using arrow keys.

      You just described my "first time" with /bin/ksh, having been raised on /bin/csh and /bin/tcsh in 1990-1992.

      As soon as I was shown "set -o vi", I never looked back. If you know how to use vi (or emacs - you can "set -o emacs"), you'll never use the arrow keys again in any shell.

    2. Re:Bash is a clone of ksh by squiggleslash · · Score: 2
      (The main reason that Unix youngers will just plain not use ksh, is lack of arrow key support. But no *real* Unix user would think of using arrow keys. Why not just find a "notepad" and Windows Explorer clone, or go back to Windows :-)
      Three words:

      set -o emacs

      I even use ksh (ok, pdksh, though I'm heartened by the fact the latest Slackware will come with the real thing. Yay!) as my shell of choice under Linux.
      --
      --
      You are not alone. This is not normal. None of this is normal.
    3. Re:Bash is a clone of ksh by PhotoGuy · · Score: 1

      Bzzzzzzt!

      A bit more of a history lesson here. The Posix standard for Unix shells is basically a conservative (but reasonably thorough) definition of historical /bin/sh. That does *not* include anything like vi/emacs editing modes, which *were* a /bin/ksh invention. So bash *did* clone those (and other stuff) from /bin/ksh. Both are supersets of Posix (and thus /bin/sh), but both are a lot more than that, and the extra cool stuff that /bin/ksh added, bash got from it. (And added it's own cool stuff beyond that.)

      If you are going to clone /bin/sh or /bin/ksh and extend it, Posix is a great place to start; it's probably the most detailed description of shell syntax you'll find.

      Next: Last I checked, ksh typically had very poor support for arrow keys; you had to map your arrow keys Xkeysym's to be the right editing keys, which broke them for other apps. bash definitely does this better. Maybe newer ksh's have better support; the standard one on Solaris 7 has the limited support described above.

      Finally, the "you young bucks" comments were meant to be a funny response to a cute historical inaccuracy by someone who obviously didn't know the full history. I'm only 30-ish myself. :-) And I consider myself to be one of the better Unix/Linux "nurterer's" around, helping a lot of folks on board with it. Definitely not l33t. :-)

      There sure are a lot of sensitive and surly youngsters out there. Lighten up; go to a rave and take some Ecstacy, or whatever you young kids do for fun these days.

      (For the seriously humour impaired, that was yet *another* joke.) -me-

      --
      Love many, trust a few, do harm to none.
    4. Re:Bash is a clone of ksh by ahuimanu · · Score: 1

      the more you despise their youth, the more they'll despise your age and wisdom. Crapping on the heads of the kids is never the solution. I am not sure you could stand in any one place and declare the parameters of a *real* unix user. Why limit and narrow? If people are used to doing things a certain way (as you are from your heyday with unix-oriented keyboards) then why not accomodate that as well? I enjoyed learning from your post, but found your l33t-ism to be just what the budding community does NOT need. J-

      --
      shock the monkey
    5. Re:Bash is a clone of ksh by Dom2 · · Score: 1

      1) Bash is not a clone of ksh. It's an independent implementation of the POSIX standard for unix shells. (It's actually a superset).

      2) ksh does support the arrow keys, it just doesn't come set up that way (in ksh88, which most people seem to relate to). Ksh93 comes set up to use arrow keys, I think.

      3) bash ain't nowhere near as cool as zsh. :-)

      -Dom

  43. Re:ksh93 as a programming language? by divec · · Score: 1

    How do you make a program work like the cd command? I mean a separate process, not the kludges that shells use.

    --

    perl -e 'fork||print for split//,"hahahaha"'

  44. Re:Why? by divec · · Score: 1

    Is long filename support not a kludge on FAT(12|16|32), even on NT/W2K? Ok, few people need to use FAT16 or FAT32 but lots still need FAT12.

    --

    perl -e 'fork||print for split//,"hahahaha"'

  45. Korn by bendawg · · Score: 1

    What's your take on the rock group Korn? Do you love them, hate them, or wish they would stop using your name?
    Do you ever plan on doing a deal where Korn is the official band of ksh, or ksh is the official shell of Korn?

  46. Re:Why? by divec · · Score: 1
    the entire GUI can be controlled from the keyboard, if necessary.

    While not quite true on Windows, this is true for xfree: press Ctrl+Shift+Numlock and use the numpad keys to navigate. Then you can even do things like freehand area selection on the GIMP without a mouse.


    I guess you probably meant keystrokes for menus etc in Windows, though. GNOME+icewm passes this test too (without having to use the numpad pseudomouse).

    --

    perl -e 'fork||print for split//,"hahahaha"'

  47. UWIN and Cygwin by Lumpish+Scholar · · Score: 3

    How would you compare the UWIN and Cygwin projects?

    --
    Stupid job ads, weird spam, occasional insight at
  48. Re:Interactive vs Programming features by redelm · · Score: 1

    I've had trouble with ^R. The closest I've come is:
    !cmd:p
    [uparrow] ... then edit.

  49. ksh93 as a programming language? by Lumpish+Scholar · · Score: 4

    What are some of the differences between ksh88 (which I think of as comparable to bash or the Posix shell) and ksh93, that makes the latest KornShell as good or better a language than Perl?

    --
    Stupid job ads, weird spam, occasional insight at
    1. Re:ksh93 as a programming language? by -x- · · Score: 1

      My main reason for preferring the Korn-Shell to Perl is familiarity. I use ksh as my main command-line-interface (CLI), so it is almost second nature to me. I am probably as close to a Korn-Shell "guru" as anyone this side of Mr. Korn, so I'm definitely prejudiced, here. However, I generally find it easier to "hand off" a shell-script to moderately technical users, than a Perl script. It's just easier for them to read and understand, because they use many of the commands every day.

    2. Re:ksh93 as a programming language? by -x- · · Score: 1

      I'm not certain what you're asking...your
      perl doesn't work on my interpreter (bad
      loop variable). It looks as if you're trying
      to display the environment in a seperate
      (child) process. If so, in KSH you'd use
      something like:

      (
      env
      #
      # other stuff in your child-process...
      ) &

      Child_PID=$!
      #
      # other stuff in your parent-process...

  50. Re:Comparison: ksh has "cd fromdir todir" by Anthony+Brundell · · Score: 1

    That's fantastic. Thanks for that function.

    --

    "moo" - cow 3, 1906

  51. Re:Comparison by erice · · Score: 1

    Actually, no, you get bash, tcsh, and zsh even if you never touch the suplement CD. Also Perl and Apache.

  52. Re: VI or Emacs? by Anthony+Brundell · · Score: 1

    yes it can

    --

    "moo" - cow 3, 1906

  53. You mean this one? by robinjo · · Score: 4

    I've been attending the USENIX NT and LISA NT (Large Installation Systems Administration for NT) conference in downtown Seattle this week.

    One of those magical Microsoft moments(tm) happened yesterday and I thought that I'd share. Non-geeks may not find this funny at all, but those in geekdom (particularly UNIX geekdom) will appreciate it.

    Greg Sullivan, a Microsoft product manager (henceforth MPM), was holding forth on a forthcoming product that will provide Unix style scripting and shell services on NT for compatibility and to leverage UNIX expertise that moves to the NT platform. The product suite includes the MKS (Mortise Kern Systems) windowing Korn shell, a windowing PERL, and lots of goodies like awk, sed and grep. It actually fills a nice niche for which other products (like the MKS suite) have either been too highly priced or not well enough integrated.

    An older man, probably mid-50s, stands up in the back of the room and asserts that Microsoft could have done better with their choice of Korn shell. He asks if they had considered others that are more compatible with existing UNIX versions of KSH.

    The MPM said that the MKS shell was pretty compatible and should be able to run all UNIX scripts.

    The questioner again asserted that the MKS shell was not very compatible and didn't do a lot of things right that are defined in the KSH language spec.

    The MPM asserted again that the shell was pretty compatible and should work quite well.

    This assertion and counter assertion went back and forth for a bit, when another fellow member of the audience announced to the MPM that the questioner was, in fact David Korn of AT&T (now Lucent) Bell Labs. (David Korn is the author of the Korn shell)

    Uproarious laughter burst forth from the audience, and it was one of the only times that I have seen a (by then pink cheeked) MPM lost for words or momentarily lacking the usual unflappable confidence. So, what's a body to do when Microsoft reality collides with everyone elses?

    ---Lisa

  54. Re:Question by spitzak · · Score: 2
    X has problems (and so does Windows) but your description is a common misconception.

    Context switches are a problem. But the difference is not that X has 2 (client->kernel->server) and Windows has 1 (client->kernel).

    The problem is "synchronous" interfaces, where you make a call and that call, besides doing something to the screen, returns a value. This actually requires 4 context switches on X and 2 on NT according to your design.

    What is needed is non-synchronous or stream-based interfaces. In this case all the things you want to draw on the screen go into a buffer and are eventually flushed. This has the potential of making the number of context switches per operation .001 (note the decimal point) or smaller!

    With such a design the overhead of not putting the server in the kernel is miniscule, and you get all the advantages of making it user level.

    The problem is that both are designed with large numbers of synchronous interfaces. Windoze has an excuse in that it is based on W3.1 where everything was synchronous, but X was designed as a server, and they really had no excuse for doing stupid things like requiring a round trip to allocate a color or to set the current font.

    I do hope that X will be replaced someday, like soon, but we should design it right. Hacks with memory mapping and direct rendering and kernel modules are nice, but none of them come close to the win you will get with an interface that is designed to be piped. The problem is that any such interface is going to incompatable, it is impossible to emulate a synchronous interface atop an async one.

  55. I'll stick with bash by q000921 · · Score: 2

    ksh was a nice enhancement, but it was proprietary for too long, and I think there is little reason to prefer it over bash now. For heavy-duty scripting, ksh may still be slightly better than bash now, but for those applications there are better alternatives: Perl, Python, Tcl/Tk, etc. In fact, for a while, ksh was trying to go for the scripting space that Tcl/Tk was in (including dynamic loading and widgets), and in that area, it was never competitive with Tcl/Tk.

  56. Re:..A little known fact.. sorry OT by atrowe · · Score: 2

    Tom Morello from Rage Against The Machine graduated from Harvard Law School before turning to a career of music and thuggery.

    --

    -atrowe: Card-carrying Mensa member. I have no toleranse for stupidity.

  57. ksh today by Y-Leen · · Score: 4
    During the design of ksh, were you limited/influenced by computer hardware and consumer market?

    Given the chance to completely redesign ksh for today's higher spec mahines and the current consumer base, what new features would you include?

  58. True Story? by travisd · · Score: 5
    Was the story about you embarrasing a Microsoftie at a conference true? Specifically, that he was insisting that their implmentation of ksh in their unix compatibility kit was true to the "real" thing and trying to argue the point with you. The argument ended when somoene else finally stood up and informed the speaker who he was arguing with.

    Just curious...

  59. Open sourcing/More about pdksh... by mirko · · Score: 2
    You can read about it here.

    Here's an extract regarding its strengths:
    pdksh's strong points are:
    • its free and quite portable - you should be able to compile it easily on pretty much any unix box.
    • the vi editing mode is better (IMHO) than that of ksh88 or ksh93 (command/file completion using tab (optional), less buggy).
    Its weak points are that there are still a few differences from ksh88 (the major one is that `echo hi | read x' does not set x in the current shell - the read is done in a separate process). See the NOTES file in the distribution for more details.

    I do believe that you could both benefit from such a collaboration and BTW, I wonder if you plan to open source ksh ?
    --
    --
    Trolling using another account since 2005.
  60. Two simple questions... by w00ly_mammoth · · Score: 3

    Unix was a system invented decades ago. Most software becomes obsolete after 5 years. This has not been the case with unix. Why is it still here?

    A corollary - is unix holding up progress? If a brilliant new system were to be written that overthrew the establishment (like unix did in its day), it would need the momentum of people supporting it. Such a momentum isn't possible when the hacker community continues to support the well established unix way of thinking. Does this in some way impede the appearance of a completely new paradigm (like unix was in its day...)? What would be the conditions that could create such a new system? After all, it's unlikely that unix will be the research OS of choice for decades or centuries - it will have to give up at some point.

    w/m

    1. Re:Two simple questions... by wfrp01 · · Score: 1

      "After all, it's unlikely that unix will be the research OS of choice for decades or centuries - it will have to give up at some point."

      It's also unlikely that autocatalytic sets of amino acids will rule the biosphere for decades or centuries or millenia or billions of years...

      UNIX is not a crystal. It changes. It adapts and evolves. It's not just a four letter word, kiddo.

      --

      --Lawrence Lessig for Congress!
  61. Kind of a shell question... by update() · · Score: 4
    There's a lot of squabbling in the Linux world about how the Unix mentality of small apps communicating through standard input/output to form a pipeline should be maintained in the new whiz-bang, GUI environments. Do you think that it can/should be done? What should be the most important considerations for such a messaging system and how should a standard be established?

    So Korn (the band) drinks Coors Light? I might have suspected...

  62. Interactive vs Programming features by redelm · · Score: 2

    I see alot of shell development going to improving scripting features. Perhaps designing languages is "sexy".

    But what about improving interactive features to make the CLI less user-hostile? Tab filename completion, searchable histories, that sort of thing. And I'm sure there are undiscovered innovations. AFAIK none of the *IX shells has the interactive features of 4DOS [one-step searchable visually modifiable history].

  63. Re:Why? by SquadBoy · · Score: 1

    I'm going to address your concerns in backwards order. Win 9x's GUI many people kind of halfway know it it still sucks. I run Gnome + E on my Linux box (Debian Testing) I can get to almost any application that I have from anywhere on my desktop by clicking on of my three mouse buttons. This as opposed to Windows where I have to go to the start button and browse through a menu or go to My Computer. May not seem like much but when you really use your machine those few seconds over the course of a day really add up. Everytime I have to use a Windows box I would kill for a virtual desktop. In short the Windows GUI sucks just more people know it. Design and implementation problems with W2K and NT. First of all there is the fact that in order for any services to be running the GUI has to be up and you have to be logged in as a user of some sort. If you don't understand why this is a problem maybe you should spend some time thinking about it in terms of resources and security at the console. Number two of a very long list. In NT (not sure about W2K here) the swap file (partition if you have it on one) can only grow it can not shrink. Problem? I think so. This next one is a bit unfair but still a problem with the implementation. It all still runs the same god damned kernel. If I don't need something (sound comes to mind) I can't take it out. Also the directory structure and the naming scheme. Support for long names is still just a hack on top of a basic 8+3 naming rule. If you have not had this fact cause you problems or at least waste your time you have not really used Windows. Also what the hell is the deal with drive letters. Is it not easier to just have everything in one tree. And as far as a W2K implementation problem try this. Put a earlier Windows box, Unix, Linux, *BSD, whatever on your network. Give it a static IP address. Boot it and pull out the network cable. When it gets back up ping the hostname. It still knows the IP address that you wanted it to have. Try the same thing with a W2K box. It does not know it's static IP anymore. This causes problems with many normally networked apps in a standalone situation. This is just a short and incomplete list of problems.

    --

    Cypherpunks: Civil Liberty Through Complex Mathematics. Those who live by the sword die by the arrow.
  64. FPATH by smillie · · Score: 1
    I've almost never see the FPATH variable mentioned by ksh users but as a programer/scripter it's one of my favorite features. Would you discuss the reasoning behind it?

    --

    Dyslexics Untie!

  65. Re:Comparison by duffbeer703 · · Score: 1

    In solaris 8, bash is shipped in a supplement cd, along with kde, gnome and other freeware utilities.

    I do not believe that sun 'officially' supports it.

    --
    Conformity is the jailer of freedom and enemy of growth. -JFK
  66. Re:Why? by Tackhead · · Score: 2
    >Its flamebait because [the poster was] starting an OS war thread instead of discussing Korn shell issues.

    Yeah, this thread's s'posed to be about shell wars, not OS wars :-)

    C shell considered harmful!

    (Actually, in all seriousness - I really like that "Csh considered harmful" - and the Korn shell rocks. I grew up on SunOS 4.x and csh/tcsh (with Bourne shell for scripting) and was led to ksh by a clued manager in my first job after graduation who said "Hey, check this out, they even say Sun might make this the standard shell someday instead of that C shell".

    Been addicted to it ever since. First thing I do is make /bin/ksh my default shell. If it ain't there, I put it there.

  67. Re:How do you feel... by keithso · · Score: 1

    Check out "Korn meets KoRN"

    The guy actually has a copy of ``The New Kornshell: Command and Programming Language'' signed by KoRn members David Silveria, Fieldy and Munky.

    --
    Keith So GnuPG fingerprint = 168F 874B 4E26 DCA8 B8BF 57F4 80F9 412E F82B AE4C
  68. on a similar note... by slothbait · · Score: 2

    I've got a somewhat similar story, actually. I randomly met Larry Ewing recently. For those new to the Linux world, this is that guy that, among other things, drew THE Linux penguin that you still see pasted all over the web. The conversation went something like this...

    Me: "So, you do a lot in the Linux world?"
    Him: "Well, you know that penguin? I was the one who drew it."
    Me: "Oh, you're Larry Ewing."
    Him: "That's right."
    Me: "Dude, that penguin is *way* over used."
    Him: *shrugs*

    ...I kinda felt bad afterwards, because he seems like a nice guy. I *was* pretty jazzed to meet a "name" in the Linux world. And it's not his fault that his art is overused. Still, I just had to say it. :)

    --Lenny

  69. ksh compatibility across platforms by toybuilder · · Score: 2

    As soon as I saw your name, I recalled the story that made the rounds several years ago about ksh compatibility by MKS's Korn shell and Windows (see end of post)...

    My question:

    As I see it, one of the big problems that continue to affect the Unix community today is that each OS vendor customize Unix in some peculiar/exclusive way.

    I can't recall anymore, but I think I ran into the problem with ksh being significantly different from Solaris with Dynix/ptx.

    Certainly, there's a lot of shell-scripting out where where platform-specific behavior is written in each script. And the shell-command tests to identify the platform were rather yucky.

    How, then, do shell's compete against PERL or Java where part of the goal is to hide almost all of the OS-specific quirks behind a layer of abstraction? And, (assuming my memory of ksh being "framgented" across platforms is correct) has ksh "defragmented" with the newer versions?

    The lead article says that ksh now is so complete that you don't need PERL anymore. But do these ksh script still have to have OS-dependent sections?

    Thanks.

    Here is the story from William Birch (which I grabbed out of the Google Cache:

    I've been attending the USENIX NT and LISA NT (Large Installation Systems Administration for NT) conference in downtown Seattle this week. One of those magical Microsoft moments(tm) happened yesterday and I thought that I'd share. Non-geeks may not find this funny at all, but those in geekdom (particularly UNIX geekdom) will appreciate it.

    Greg Sullivan, a Microsoft product manager (henceforth MPM), was holding forth on a forthcoming product that will provide Unix style scripting and shell services on NT for compatibility and to leverage UNIX expertise that moves to the NT platform. The product suite includes the MKS (Mortise Kern Systems) windowing Korn shell, a windowing PERL, and lots of goodies like awk, sed and grep. It actually fills a nice niche for which other products (like the MKS suite) have either been too highly priced or not well enou gh integrated.

    An older man, probably mid-50s, stands up in the back of the room and asserts that Microsoft could have done better with their choice of Korn shell. He asks if they had considered others that are more compatible with existing UNIX versions of KSH.

    The MPM said that the MKS shell was pretty compatible and should be able to run all UNIX scripts.

    The questioner again asserted that the MKS shell was not very compatible and didn't do a lot of things right that are defined in the KSH language spec.

    The MPM asserted again that the shell was pretty compatible and should work quite well.

    This assertion and counter assertion went back and forth for a bit, when another fellow member of the audience announced to the MPM that the questioner was, in fact David Korn of AT&T (now Lucent) Bell Labs. (David Korn is the author of the Korn shell)

    Uproarious laughter burst forth from the audience, and it was one of the only times that I have seen a (by then pink cheeked) MPM lost for words or momentarily lacking the usual unflappable confidence.

    So, what's a body to do when Microsoft reality collides with everyone elses? Next topic for demonstration, please...

  70. Re:Why? by divec · · Score: 1
    can't NT format an NTFS floppy anyway?

    Dunno, but since the purpose of floppies is interoperability, for some circumstances that could be as useless as me formatting a floppy ext2. Sure, I agree floppies *should* be legacy.
    --

    perl -e 'fork||print for split//,"hahahaha"'

  71. Re:Why? by skt · · Score: 1

    Yeah right. You and I both know that the Windows 2000 "mount" feature is a joke. I actually just found out about it a few weeks ago. It turns out that there is even a >5 step wizard that guides you through the whole mount process, heh. I still haven't been able to figure out how it works yet as it isn't very intuitive.

    And on top of that, Windows doesn't have any support for symlinks. Huge limitation IMHO, I guess we'll have to wait for whistler for another "new feature" that is nothing more than a crude hack. Oh well, I'm getting used to them now. Windows 2000 now has a telnet service so that you can "telnet to your win2k box". Wow, what will M$ think of next?

  72. What functionality/code in ksh r u least proud of? by segmond · · Score: 4

    It is very hard to find a programmer who is completely satisified with his code. No matter how happy she is with it, there is always that part which she wishes to improve. As far as ksh is concerned what is it that you wish you didn't do, can improve?

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  73. Jed by Ka0s · · Score: 1

    JED!!!!

  74. Re:Why? by SquadBoy · · Score: 1

    Would someone please tell me why the above is flamebait? I really do not understand why something like this would be good. I do not think I threw out a insult (If I did I am most sorry). I just really do not understand and would like to know more from someone who has clearly put alot of thought into it. Why is that flamebait?

    --

    Cypherpunks: Civil Liberty Through Complex Mathematics. Those who live by the sword die by the arrow.
  75. Re:KSH on Solaris.... Why is it so poorly set up? by wobblie · · Score: 1

    really ... i tried solaris x86 just for shits and giggles, and when faced with a totally unconfigured ksh, I just gave up after a few days.I couldn't figure out how to set emacs editing mode to save my life. Same with BSD and that horrible csh.

    No wonder unix was going down the tubes. who the hell is going to be able to figure this out as a newbie?

    What the fuck is with these people?

    --

  76. UWIN and etc by rabtech · · Score: 5

    You once said that you had to learn Windows NT because you couldn't criticize what you didn't know. What I'd like to know (as a primarily Windows programmer) is what do you consider to be the best and worst parts of both the Windows NT/2000 model and the UNIX model. What advice can you give? Also, has working on the UWIN project given you any insights that you can share with the rest of the community?
    -
    The IHA Forums

    --
    Natural != (nontoxic || beneficial)
  77. Re:Interactive vs Programming features by smillie · · Score: 1
    ksh has filename completion and searchable history. Since use it in vi mode the command for completion is escape then backslash. Tab would be better except when you are trying to type a tab on the command line.

    The search command is escape then "/" then the search word. Slash by itself again will find the next hit.

    I can't do: sed 's/[tab]/ /' in bash but can in ksh but other than that bash is nice.

    --

    Dyslexics Untie!

  78. Standard UNIX shell... cough by n_reduce · · Score: 1

    Strange assertion - bash 'seeming' to be the standard UNIX shell. Since it isn't available by default on many (or is that any?) commercial UNICEs.

    Why use ksh over bash? Well ksh will be supported on your local UNIX variant and bash probably won't.

    Actually I think possibly you have got your question the wrong way round. Bash has copied most of its features from ksh, and added a few things of its own. So I think it may be fair to call bash a functional superset. So it may be fair to reflect on what is missing from ksh that is in bash - things like PROMPT_COMMAND for a start.

    1. Re:Standard UNIX shell... cough by utunga · · Score: 1

      in my personal experience admittedly, mostly in recent history, real working stiffs such as myself, and especially joe blows at home encounter, primarily, bash.
      'standard' has to be a word that shifts with the times..

  79. Books? by jotaeleemeese · · Score: 1

    What are your favorite books:
    -About ksh?
    -Computer science in general?
    -Novel?

    --
    IANAL but write like a drunk one.
  80. What is your favorite hardware setup? by harhar · · Score: 1

    What is your favorite hardware setup? Moniter? CPU brand(RISC right?)? Video controller(gamer at all?)? Do you get to play with those new 8-way IBM G3s? Tell us so we can drool about all the new prototype gear.
    $var = &ltSTDIN>
    $var =~ s/\\$//;

    --
    $var = &ltSTDIN>
    $var =~ s/\\$//;
    this is slashchomp
  81. Music Tastes by nharmon · · Score: 1

    You obviously are a fan of Korn (the band). What other groups do you listen to?

  82. Re:Why? by kangasloth · · Score: 1

    NT won't let you, no. I believe {sys,win}ternals has a hack to do it, but it's all but pointless: a fresh fs takes up most of the floppy.

  83. What happened to ksh2000? by Mr-Pope · · Score: 1

    I heard that was planned, and now 2000 is long gone. Mr-Pope

    --
    "The only way to learn a new programming language is by writing programs in it." - Brian Kernighan
  84. GCC, GPL and the UWIN project by guerby · · Score: 1
    The GCC Steering Committee recently announced the Removal of support for GCC hosted on UWIN:
    To: gcc at gcc dot gnu dot org, gcc-announce at gcc dot gnu dot org
    Subject: Removal of support for GCC hosted on UWIN
    From: Mark Mitchell mark at codesourcery dot com
    Date: Tue, 09 Jan 2001 00:39:17 -0800

    We've learned that the usage of GCC on U/WIN involves a violation of the GNU GPL, linking GCC with a non-free third-party support library; therefore, we have removed the support for such usage.

    Note that GCC is merely a special case: it is a violation of the GPL to link *any* GPL'd program with the U/WIN support library.

    --
    Mark Mitchell
    mark@codesourcery.com
    CodeSourcery, LLC
    http://www.codesourcery.com

    Could you tell us more about this issue?

    --
    Laurent Guerby <guerby@acm.org>

  85. Error-Trapping inside pipelines by -x- · · Score: 1

    My only significant gripe with the current Korn-Shell specs is that errors that occur within a pipeline (except in the last element thereof) don't trigger traps. For example:

    trap "echo error" ERR
    echo "hello" | false | cat -

    will not trigger the "echo error" action, but will instead try to read from the console. This is a real problem when trying to build "industrial strength" scripts, because error-trapping is a critical part of that. Sure, you could just say "don't use pipes"...but that cripples one of the main advantageous features of the shell!

    1. Re:Error-Trapping inside pipelines by -x- · · Score: 1

      Sorry...I have "set -e" in my $ENV processor subshell.ksh) when running a non-interactive shell, so I don't normally have to type it by hand. A better example would be:

      set -e
      trap "echo error" ERR
      true | false | echo "shouldn't be here"

  86. Variables within Loops by -x- · · Score: 1

    A minor gripe about the korn-shell is that variables set within while or for loops tend to fall "out of scope" outside the loop. This is a bit of a hassel when trying to generate a stream-parser that sets variables based on tags (rather than position-within-stream).

    It might be worthwhile to consider a "set" flag that allows controlling this behavior.

  87. Re:Question by spitzak · · Score: 2
    This is what I was saying. X is designed to by asynchronous.

    However, besided bad drivers, there are numerous mistakes in the Xlib interface so that many of the "asynchornous" calls are always followed by a wait for a response from the server. For instance the call to register an Atom requires the server to check to see if it is registered, allocate a new number, and return it. Xlib must block until this value is returned, because the Xlib interface is a function that returns the atom.

    There is very little that can be done about this because it is almost impossible to add extenstions or change the design of the X server. I think it would be faster to use string tokens than to use the bi-directional atom mechanism. Or you could give each process it's own Atom space, with translations done by the server to messages between processes (this requires the location of Atoms in each message to be identified, which is nearly impossible). It does appear that Windoze has learned to batch requests as well, they added a GdiFlush() call. They probably also call this when you do GetMessage and some other system calls.

  88. Re:what about enhancing ksh syntax ? by flynn_nrg · · Score: 1

    -rwxr-xr-x 1 bin bin 3157516 Jul 14 1998 /usr/local/bin/bash Try applying strip to the file, it probably was compiled with -g as well, and every file compiled with -g on a Solaris system will by huge, e.g. the wine lib is more than 100MB if compiled with -g.

  89. Re: VI or Emacs? by -x- · · Score: 1

    Wrong viewpoint: g/foo/-1 s/bar/barre/\ +2s/Alpha/Beta The above is a multiline command (not just one that affects multiple lines). The terminating backslash on all but the last line is, of course, required. The vi implementations I've used don't support this approach...

  90. Re:[OT]Re:Comparison by Mr-Pope · · Score: 1

    set -o vi
    To put yourself into vi line-editing mode works in both bash and ksh, then under bash and ksh this will work:

    [escape]\

    fills in the rest of the filename.

    On a seperate note, I always just customise my bash shells to work like ksh. I've always been a fan of ksh, definately the best command line shell. Though, bourne shell is still the most efficient for scripting (Of shells, back off, perl-dudes!).

    Mr-Pope

    here's some .bash_profile for ya:
    # .bash_profile

    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi

    # User specific environment and startup programs

    PATH=$PATH:$HOME/bin
    ENV=$HOME/.bashrc
    VISUAL="`which vi`"
    USERNAME=""

    # aliases and set options
    alias which="type -path"
    alias r="fc -e -"
    set -o vi

    umask 0077

    export USERNAME ENV PATH VISUAL

    --
    "The only way to learn a new programming language is by writing programs in it." - Brian Kernighan
  91. A question for Korn by cje · · Score: 2

    I've been an admirer of your work ever since I was exposed to it. How much of your material was inspired by earlier developers, such as Nine Inch Nails, Skinny Puppy, and Ministry?

    --
    We're going down, in a spiral to the ground
  92. (Try it again) by -x- · · Score: 1

    Sorry - the HTML formatter ate the lines...

    Wrong viewpoint:

    g/foo/-1 s/bar/barre/\
    +2s/Alpha/Beta/

    The above is a multiline command (not just one that affects multiple lines). The terminating backslash on all but the last line is, of course, required. The vi implementations I've used don't support this approach...

  93. Linx Distributions non compliance. by keepper · · Score: 1

    This might seem a little offtopic, but it really is no.

    How do you feel about what some linux distributions do, they replace the Bourne Shell with the Bourne Again Shell.

    /bin/sh != sh /bin/sh == bash

  94. Interprited Language? by Splatta · · Score: 1

    Being a Solaris admin, I mainly use ksh for scripts. I know that Solaris ships with an older version of ksh (quite old as i know it), and lacks certain features that the latest versions of ksh has. I heard you're trying to make ksh more of an interpreted language, much like Perl or Python, and i would love to have that kind of functionality.

    My question is: Are you working with Sun to include a newer version of ksh with thier operating system?

  95. Re:what about enhancing ksh syntax ? by Mawbid · · Score: 1

    Ehm, bash can't be 3157516 bytes on Solaris. That's 3 megs! Since it was apparently built locally, I guess it has debugging symbols. My /bin/bash is 400k, btw, larger than the 300k you mention. No wonder boot floppies use a more lightweight shell.
    --

    --
    Fuck the system? Nah, you might catch something.
  96. Public Apology by watanabe · · Score: 5
    Dear Dr. Korn, I feel I owe you an apology, and this seemed like a great chance! I went to school with Adam at Brown. And, in 1993, my roommate, Matt Smith, woke me up at about midnight, excitedly telling me "Do you know the Korn Shell? This guy's dad wrote the Korn shell!!!" He was coming in with Adam from somewhere.

    I sort of turned over in my sleep, (I was extremely groggy), and said "I hate the Korn shell." and went back to bed. Adam never really talked to me after that, although he was polite enough to me at parties.

    So, Dr. Korn, I feel I owe you an apology. I didn't mean to disrespect your lifework in front of your son! I still can't use the korn shell, but call it fear of the unknown, please, rather than lucid comments on your code.

    Peter Vessenes, Brown '97

  97. KSH on Solaris.... Why is it so poorly set up? by jalbro · · Score: 1

    I love the history and tab completion features of BASH. It works perfect on any Linux box I sit down at, and when it is put on a Sun box it makes life so much better. I would like to take advantage of the fact that Sun packages KSH with the OS, but I have found that none of the usability features are pre-configured. Even the teacher of a sys admin class had trouble setting it up. What gives?

  98. Re:Why? by Masem · · Score: 2
    One problem is that for a machine of equivalent CPU, memory, etc, developing under a unix-like environment within Windows is much faster and efficient that developing on a true unix environment running X-Windows, and much much much more efficiently than playing with the console. I've found that I can move between windows faster, and because most useful documentation is online, regardless of your opinion on them, the Windows browsers work much better here.

    I also can see it for cases where you remotely develop unix apps where the connectivity between the unix box and your workstation (in this case, a windows box), is poor. I did this when I had a dialup during school stuff. Make sure everything works well in Windows, and then transfer to unix, and double check to make sure it works; assuming the ports are true, then you have no problems.

    --
    "Pinky, you've left the lens cap of your mind on again." - P&TB
    "I can see my house from here!" - ST:
  99. How do you feel... by tj8 · · Score: 2

    about the fact that the band that bears your namesake sucks out loud?

    --
    Sig this.
  100. What is a "Fellow", and what does it entail? by Angelwrath · · Score: 2

    Can you describe what it is to be a "Fellow" at AT&T, the work you like to focus on in that role, and how a person becomes a fellow?

    On the third part about how a person becomes a fellow, what amount of experience or qualifications does one need?

    Cheers!

  101. Ksh Programming For the Web by Dom2 · · Score: 3

    How do you feel that ksh holds up for web programming? I have always enjoyed programming shell scripts more than anything else, but I have always been unhappy with the shell idioms for parsing securely and correctly (the myriad of substitution operators is a nightmare to control). This is one area in which Perl has really taken the lead. How do you think shell programming could be better adapted for the web?

    Also, how do you feel about most commercial Unix vendors (and projects like pdksh) that are still shipping ksh88 as the default, 13 years later? ksh93 has many more useful features, but the takeup has been slow.

    Thanks,
    -Dom

  102. Re:Why? by smillie · · Score: 1
    Its flamebait because you were starting an OS war thread instead of discussing Korn shell issues. Yes windows sucks, yes I don't like to use it either but this is about Korn shell not windows. Perhaps it should have been better modded offtopic instead.

    --

    Dyslexics Untie!

  103. KSH Open Source by bumperson · · Score: 1

    Recently, ksh became open source (see announcement on http://www.kornshell.com) and slackware started to distribute KornShell 93. (See http://www.slackware.com). Can you clarify what the licencing terms are? Also, will ksh be included with other linux distribtuions? When? Will it replace pdksh on these systems?

  104. Re:Why? by Herschel+Cohen · · Score: 1

    What if you have no choice, here UNIX runs on top of NT.

    I am getting my first chance to develop with UNIX tools and ksh; moreover, I am just happy to get to use these tools as a professional.

    By the way, I routinely switch between the two OS's and use what is appropriate at the moment.

  105. [OT]Re:Comparison by ethereal · · Score: 1

    I have to ask, although this isn't strictly on-topic: how do you enable filename completion with Esc-Esc in bash, rather than using Tab? Having learned to code on HP-UX, and still being forced to use it daily, I can get over most ksh-isms but I spend half an hour in the evening retraining my pinky to hit Tab for Linux, and then half an hour in the morning retraining it to hit Esc for ksh. I've tried different settings in my .bashrc, but they don't seem to be compatible with vi line-editing mode. Does anyone know a good setup that allows Esc-filename completion and vi editing mode under bash on Linux?

    --

    Your right to not believe: Americans United for Separation of Church and

  106. Why? by SquadBoy · · Score: 2

    This is a honest quetions. But why port Unix applications to Windows? The underlaying OS is still (IMO) *very* poorly designed and implemented so what would really be the point of running a Unix application in this environment. I would think it would make more sense to develop killer apps that will make people want to learn Unix rather than giving Microsoft the abillity to say that their platform can also run that same application. So with all due respect, keep in mind I do think you most likely know more about this then I do, what is the point?

    --

    Cypherpunks: Civil Liberty Through Complex Mathematics. Those who live by the sword die by the arrow.
    1. Re:Why? by mrhartwig · · Score: 1

      Swapfile: grows if you need more. If you _need_ more, why would it then be shrunk later?

      Uh, maybe when I close apps....

    2. Re:Why? by jasonbasic · · Score: 1

      Is any there any point being very passionate about any paticular OS/platform? I'm all for Linux or any other OS or platform. Yet, in my opinion, they are becoming less and less relevant. New platfroms are cropping up everywhere, so applications need to be increasingly generic? No type of task or feature is ever unique to an OS anyway. So I think it's neat that people are working on building bridges between platfroms and OS.

    3. Re:Why? by SquadBoy · · Score: 1

      Did they not mention UWIN in the story. Would this not make a question about UWIN (along with my reasons for asking the question) ontopic. Had I said insulted David or not phrased it in such a way that made it clear (at least I thought so)that it is a honest question based on my observations you would be right. Otherwise I just don't see it.

      --

      Cypherpunks: Civil Liberty Through Complex Mathematics. Those who live by the sword die by the arrow.
    4. Re:Why? by Anonymous Coward · · Score: 1

      Clearly, your opinion ain't worth shit.

      What are the design problems with NT, particularly W2K? Also, what implementation problems are you referring to?

      Or are you doing the typical GNUtard thing and talking about win9x - which, incidentally, still provides a better GUI than any Open Source efforts?

  107. Re:..A little known fact.. sorry OT by nyteroot · · Score: 1

    woah, buddy, hold it right there.. tom morello is the man. as are all the other members of RATM. RATM > *. thuggery? he's a politial activist!

    --
    Ratio of replies to old sig content : replies to actual post content > 0.5. Sig changed.
  108. Comparison by Shadowlion · · Score: 5

    Background: the only shell I've ever really used is bash. Bash has always seemed to be the standard UNIX shell (or, at least, the standard default UNIX shell), and for the most part I've always been able to do what I wanted in it.

    Question: can you engage in a little unadulterated advocacy for a moment to offer some reasons why an informed user might consider using ksh over bash or other popular UNIX shells? What does ksh provide that other shells don't? Similarly, can you give a realistic appraisal of ksh's drawbacks as compared to bash or other shells?

    Thanks.


    --

    1. Re:Comparison by SquadBoy · · Score: 2

      I think you meant Linux shell. Most other Unices come with either the csh or the sh. And of course all of IBM's stuff has the ksh by default. Although the first thing I do to a new SGI or Sun box is put bash on it, it is for the most part not there by default. Although I'm very interested in the answer to your question you might in the meantime take a look at Running Linux which has a very good comparision. Of course straight from the man who wrote the shell should be very interesting.

      --

      Cypherpunks: Civil Liberty Through Complex Mathematics. Those who live by the sword die by the arrow.
  109. howto... by Marketolog · · Score: 1

    It can be done via 2 ways:

    1. you screw up your autoexec.bat and config.sys files and make it run some sort of norton commander. You can do almost anything from there (like from a shell). When you exit norton, GUI would boot. Or, of course, a multi-level, multi-choice boot sequence.

    2. You can create a "link" to "command.com" file, set it to run in ms-dos mode. When double-clicked, you'll reboot into ms-dos (starting your ms-dos application...). You can always exit by typing "exit".

  110. Q: What are your thoughts of speeds of shells? by Mr-Pope · · Score: 1

    Sir Korn,

    What are your thoughts on the difference of speed in shells: sh, ksh, bash, mostly. I've always been taught to do any serious shell script in the bourne shell, which I do. It's feature-less-ness is great for speed and efficiency. Also, what are your thoughts on perl? Again, related to the speed of execution/interpretation.

    Now I may only use sh to script, but I think that your shell is the most efficient for command-line usage. Once I started using ksh, I never touched csh again...

    Thanks for a great shell!

    Mr-Pope

    --
    "The only way to learn a new programming language is by writing programs in it." - Brian Kernighan
  111. Urban legend? by jbailey999 · · Score: 2

    I heard an urban legend once about a microsoft seminar where they were announcing they they had a fully complient Korn shell available with their operating system. A gentleman in the audience stood up to tell them in exactly what ways it wasn't compliant and promptly got into an argument with the Microsoft VP. Apparently the person in the audience was David Korn. Is this true?

    =)

  112. Re:Question by wowbagger · · Score: 2

    X is asynchronous. Xlib buffers the commands that are going to X, and sends them en masse when appropriate. Therefor, not only do you NOT get two context switches per operation, you don't even get ONE.

    For example, if I draw a line, then draw another line, then a third, Xlib will not only buffer those requests and send them over as one bunch, it will examine the lines to see if the operation can be converted into a single polyline operation.

    This also benefits the system in that once X starts working on the commands, it can resolve several things at once, thus increasing the likelihood that the X routines and data will be in the CPU cache. The Windows approach virtually guarantees the graphics libraries will be faulted out of the working set.

    What makes X "slow" in most people's experience is the fact that the X servers receive far less optimization than the Windows servers, esp. when dealing with commodity x86 hardware. A proper X server, optimized just as the Windows drivers are optimized, is as fast as Windows, and in cases where the card can perform operations in the background, faster.

  113. Re:Interactive vs Programming features by wobblie · · Score: 1
    [one-step searchable visually modifiable history].

    CTRL-R in bash. bash has a very rich feature set with command history. check out the man page.

    ksh and bash have all the features you could want. Unfortunately, commercial unix vendors ship everything as user hostile as possible, and ksh is totally unconfigured. Even Alan Cox posted a rant about hp sending a box with ksh, he had trouble with it. So I don't feel so bad.

    Thanks to some HP/UX wizard son the linux hppa porting list I now have the HP/UX box believing that subnet zero is legal. I've downloaded large chunks of ftp.gnu.org and it is currently building enough to make the machine usable. It's amazing how much you miss -good- unix command line tools after you get used to Linux and the GNU ones. How Unix vendors can ship ancient shells with no job control and no cursor editing by default and still wonder why people buy NT is beyond me.
    --Alan Cox


    --
  114. Re:Interactive vs Programming features by zygut · · Score: 1

    If you want tab filename completion, searchable histories, etc. use zsh - it is just ksh with features. Just as tcsh was an improvement of csh in that it added a lot of the interactability features, so does zsh do for ksh, and wow is it cool.

  115. Re:What functionality/code in ksh r u least proud by ibpooks · · Score: 1

    You're talking to a Master for crying out loud!

    What functionality or code in ksh are you least proud of, Sir?

    Show some respect!

  116. What do you call it? by hemp · · Score: 1

    Do you say 'the korn shell' or 'my shell'?

    --
    Skip ------ See the latest from http://www.anArchyFortWorth.com
  117. Unfair question by Herschel+Cohen · · Score: 1

    I have just begun to use ksh, by the way using the circa '89 book as my guide. Why is the a reworked Bourne shell the standard in Linux, when ksh seems to be superior?

    Was ksh too large at the time, or was it offered only on a restricted basis at the time Linux was being created?

  118. Feature request by mirko · · Score: 2

    I just read the ksh FAQ and I found this :

    Q6. Are any further releases of ksh planned?
    A6. Yes, we are in the process of planning for a newer version, ksh200X.
    We are interested in suggestions for new features.
    Again, most of the focus will be on scripting and reusability.


    As I believe this poll is also aimed at defining these improvements I was thinking of the following:
    Ksh is supposed to make people's life easier and I use it whenever integrating e-payment software on my servers.
    I was then wondering whether some feature that I saw in VMS could be implemented in Ksh: directory-specific profiles.
    For example, you log on and set your environment (profile) with your .profile. It'd be cool, IMHO to have the possibility (which could be activated or not whenever launching ksh) to set some .profile files in any directory so that by changing directories, one could easily update its configuration to the most relevant settings.
    This would not only apply for a user working with the prompt but also whenever launching some specific scripts that are suppose to activate some binaries or whatever else somewhere.
    This would then allow some context-sensitive programs to be automatically executed with a minimal knowledge of the environment.
    So, I wouldn't have to say to the logged user to set their environement a given way whenever working or not with some apps.
    BTW, some similar feature also exists on Acorn RiscOS platforms and really makes one's life easier.
    I think this is not incompatible with Unix and may even widen its possibilities (from the user's point of view).

    Finally, here's my question: Do you want to restrict Ksh to fit a stereotypic Posix environment look'n feel or are you working to make it a real enhancement of such systems, especially in ergonomy?
    --

    --
    Trolling using another account since 2005.
  119. what about enhancing ksh syntax ? by mirko · · Score: 3
    Ksh is quite cool as it is much more compact than bash ; here are their respective sizes on a Solaris system :
    • -> /usr/local/bin/bash -version
      GNU bash, version 2.02.0(1)-release (sparc-sun-solaris2.6)
      Copyright 1998 Free Software Foundation, Inc.

      -> ls -la /usr/local/bin/bash
      -rwxr-xr-x 1 bin bin 3157516 Jul 14 1998 /usr/local/bin/bash
    • # ksh -o emacs
      # Version M-11/16/88i

      # ls -la `which ksh`
      -r-xr-xr-x 2 bin bin 186356 Jul 16 1997 /usr/bin/ksh
    On a Linux system, these are approximately 300k for bash and 160k for (pd)ksh.
    In which direction do you plan to improve it ?
    Will you rather keep it compact or extend its functionalities regardless the volume increase ?
    This issue is quite important for me as, as of yet I am working upon some System-on-a-floppy distribution and the size appears to be critical in this context.
    --
    --
    Trolling using another account since 2005.
  120. Who are you? Where are you going? by CritterNYC · · Score: 1

    Shutton: Uh, Dave Shutton, Springfield Daily Shopper. Who are you? Where are you going?
    Kent: Oh, do your research, Shutton!

    Ever notice most of the questions people ask in these things are already answered in the FAQs, manuals and news items on various sites. Luckily, it's usually only the better questions that get modded up.

  121. So, Dave ... by Anonymous Coward · · Score: 4

    Quick question: Vi or Emacs?