Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!udel!rochester!kodak!ispd-newsserver!ism.isc.com!robtu From: robtu@itx.isc.com (Rob Tulloh) Newsgroups: comp.sys.amiga.misc Subject: Re: SKsh variables Message-ID: Date: 4 Apr 91 23:07:33 GMT References: <6765@khaki14.UUCP> <37090008@hpfcdc.HP.COM> Sender: usenet@ism.isc.com (Ism Usenet News) Organization: Interactive Systems Corp. Lines: 64 koren@hpfcdc.HP.COM (Steve Koren) writes: First, let me refer back one post to the variable substitution request. I, for one, would love to see this in sksh as it one of the big advantages of using ksh over other shells which force the used of basename, dirname, and sed to accomplish simple substitutions/deletes. So if asking helps.. >> Let's here it for this request! And could I also request redirection >> syntax so that I can do things like: >> prog 2>&1 | more >Redirection syntax already is in there (ie, try "command > file"), >but the case you point out above is something slightly different. >It directects stuff sent to stderr (file descriptor 2) to go to stdout. >The Amiga doesn't really differentiate stderr and stdout - programs >have just one place to dump output to, unless they open up another >output themselves. I had been wondering about this. I couldn't decide if the Amiga had a notion of file descriptors or not since the native CLI only lets you do things like < and >. >Since 99% of all programs don't make a distinction >between stderr and stdout, SKsh doesn't support assigning one to >the other. There is also a limitation on where redirection symbols >can come in a line: at the beginning or end only. Thus, you can >say: > cmd1 | cmd2 > output >but not: > cmd1 > output | cmd2 >which is logically the same thing but slightly more confusing. >There is another difficulty in piping things to more on the Amiga. >Some "more" commands will, if they detect that stdin is not a console, >open up the console themselves. These more commands can be piped >to. Most, however, won't check, and so you can't pipe stuff into >them. You have to find an applicable more command before you can >use it with pipes. I take it that released version of more (the one that shipped with the machine) does the open the way you say some programs do? I cannot explain why my progs which write to stderr don't interface to more the way I want them to. I would be suspicious of less since it goes to the trouble of opening its own window, but how about native more? > - steve Another question, is there a limit to the number of filenames that sksh shipped grep will accept on its command line? I wasn't aware of a limit on the command line length. A simple test of echo seemed to indicate it was capable of handling a lot of arguments (echo * */* on a rather large directory with lots of subdirectories). Is there a limit that grep imposes? Thanks for the feedback on these items. I find it very useful. Rob Tulloh -- INTERACTIVE Systems Corp. Tel: (512) 343 0376 Ext. 116 9442 Capital of Texas Hwy. North Fax: (512) 343 0376 Ext. 161 (not a typo!) Arboretum Plaza One, Suite 700 Net: robertt@isc.com (polled daily) Austin, Texas 78759 GEnie: R.TULLOH (polled monthly)