From owner-freebsd-questions@FreeBSD.ORG Thu Dec 20 13:05:51 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CB6216A41A for ; Thu, 20 Dec 2007 13:05:51 +0000 (UTC) (envelope-from jurjenm@stack.nl) Received: from mx1.stack.nl (meestal-mk5.stack.nl [IPv6:2001:610:1108:5010::149]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8D013C4E1 for ; Thu, 20 Dec 2007 13:05:51 +0000 (UTC) (envelope-from jurjenm@stack.nl) Received: by mx1.stack.nl (Postfix, from userid 65534) id 0242141C57; Thu, 20 Dec 2007 14:05:50 +0100 (CET) X-Spam-DCC: Rhyolite: toad.stack.nl 104; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on toad.stack.nl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.2.3 X-Spam-Relay-Country: NL Received: from jurjen (wlan-197193.nbw.tue.nl [131.155.197.193]) by mailhost.stack.nl (Postfix) with ESMTP id 8D8A9420D7; Thu, 20 Dec 2007 14:05:33 +0100 (CET) Received: by jurjen (sSMTP sendmail emulation); Thu, 20 Dec 2007 14:03:31 +0000 Date: Thu, 20 Dec 2007 14:03:31 +0000 From: Jurjen Middendorp To: Chuck Robey Message-ID: <20071220140330.GA1100@s062107.tue.nl> Mail-Followup-To: Jurjen Middendorp , Chuck Robey , FreeBSD Questions References: <20071214010542.GA19553@demeter.hydra> <200712132012.32729.mike.jeays@rogers.com> <20071214211008.GA12935@melon.esperance-linux.co.uk> <20071215021349.GF2062@kobe.laptop> <1197850883.4230.3.camel@tomcat.straycat.dhs.org> <4765EC7E.6050704@chuckr.org> <1197866090.6951.6.camel@tomcat.straycat.dhs.org> <20071217084051.GA1121@s062107.tue.nl> <4766DCE6.6000902@chuckr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4766DCE6.6000902@chuckr.org> User-Agent: Mutt/1.4.2.3i Organization: FOTLP (Federation Of Terribly Lazy People) Cc: FreeBSD Questions Subject: Re: pdksh vs. mksh info [was: Re: Apparently, csh programming is considered harmful.] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2007 13:05:51 -0000 On Mon, Dec 17, 2007 at 03:32:38PM -0500, Chuck Robey wrote: >Jurjen Middendorp wrote: >>>> If you're familiar with pdksh, are you also familiar with ksh93, which >>>>is (I believe) Mr. Korn's own shell? If you are, I would be interessted >>>> in your opinion of the two, any comparisons you might give. >>>I've never used ksh93 so I really can't say. There is a NOTES file >>>included with pdksh which gives a starter. I created this port a few >>>years ago because of some random issue I've long since forgotten with >>>pdksh on my FreeBSD box which didn't happen on my OpenBSD box. >>> >>>tom >> >>I never used pdksh, but am using ksh93 for quite a while now and have used >>bash, too. For some reason i like it better than bash, the vi mode is a bit >>better somehow, it feels alot sturdier. It doesn't have those special >>variables like $! and !! i believe, but it has alot of neat features like -----------------^ i ment !$ offcourse :) >>basic network programming, lots of parameter expansion stuff and is just a >>very nice shell :) > >I havre installed it, and played with it a bit, I admit it's nicer than >sh (and I *think*, bash) but the reason I haven't tried using it >regularly is because I can't find a nicely set up .kshrc ... if you have >one, I'd appreciate a copy. Might be nice, if it's not terribly long, >to post it to the list, too. Basically it's just like any other shell .*rc. It sets some environment variables for stuff, a bunch of aliases and some functions i find useful myself, or am too lazy to throw away. Nothing really ksh-specific, except maybe some of the functions i wrote use ksh-stuff like arrays, but that's not really ksh-specific as well. You could use google to find any .*rc for sh-like shells and copy those (or get a copy of unix power tools, it's a nice book to make you feel at home in a shell) -jurjen ps. these functions i probably use the most :) alias d="do_in_bg dillo" alias x="do_in_bg xpdf" alias ff="do_in_bg firefox" #do a program in the background: do_in_bg() { "$@" > /dev/null 2>&1 & } #open a webpage from disk, like: $cd /usr/share/doc/en && htm #to look at all the (english) freebsd-docs :) htm() { set -A stuff $(find -L . -name "index.htm*" -print) (for ((i=0; i < ${#stuff[*]}; i++)); do print "$i \t: ${stuff[i]}"; done) | $PAGER read x && d ${stuff[$x]} }