From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,f7f68e18cfb8d31b X-Google-Attributes: gidfa528,public X-Google-Thread: 1012a6,f7f68e18cfb8d31b X-Google-Attributes: gid1012a6,public X-Google-ArrivalTime: 2003-12-23 08:06:51 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!peer01.cox.net!cox.net!cyclone1.gnilink.net!cyclone.rdc-nyc.rr.com!news-server.columbus.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!twister.rdc-kc.rr.com.POSTED!53ab2750!not-for-mail From: "Dan Mercer" Newsgroups: comp.unix.shell,comp.unix.tru64 References: <0z_Eb.170955$Eq1.160079@twister.rdc-kc.rr.com> Subject: Re: Unexpected result from grep X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Tue, 23 Dec 2003 16:01:49 GMT NNTP-Posting-Host: 24.163.211.18 X-Complaints-To: abuse@rr.com X-Trace: twister.rdc-kc.rr.com 1072195309 24.163.211.18 (Tue, 23 Dec 2003 10:01:49 CST) NNTP-Posting-Date: Tue, 23 Dec 2003 10:01:49 CST Organization: RoadRunner Xref: archiver1.google.com comp.unix.shell:3787 comp.unix.tru64:11056 "Peter da Silva" wrote in message news:bs7msf$19vu$1@jeeves.eng.abbnm.com... : In article <0z_Eb.170955$Eq1.160079@twister.rdc-kc.rr.com>, : Dan Mercer wrote: : > Portability using a minimal sh functionality pushes the burden of portability : > from the shell to the OS. : : That's one way of looking at it, I suppose. Really, though, that viewpoint : is confusing correlation and causation. : : Just because you're running ksh or bash or zsh doesn't mean you're running : a new awk or that perl is installed. Writing a script in a less portable : way, from the point of view of the shell, doesn't provide any guarantee : that all the program invocations in the script are going to work. And : writing it in a more portable way doesn't change the version of awk already : installed on the target system into gawk. But it severely lessens the need to invoke awk or sed, etc. Because of extended globbing, and the new parameter substitution forms, there is no need to invoke awk for trivial purposes, as so often was done in the past. The less you need external programs, the less you need to worry about their portability. : : All you can say is that a system with a newer shell installed is more likely : to have newer versions of other programs, Not the point at all. I had many bourne shell scripts that relied on awk. Because of problems with the vendor breaking awk, I switched to gawk. But that meant I had to support gawk if I continued to use it on a long term basis (which meant paperwork I won't go into). After the vendor broke awk the third time, I decided to just pull it out of all the scripts. I was shocked to find the scripts actually executed faster! but if other parts of the code : are non-portable then all you're doing is hiding any deeper problems : and make it harder to isolate them when they do show up. And in the : meantime you're adding to system complexity by forcing people to install : multiple different shells. Ksh is pretty standard. Only Linux installs wouldn't come standard, but there, at least, you can install real ksh93. : : As for using the "#!/bin/ksh" to discourage the use of older shells, you : can get the same results by putting that line there without actually using : a single ksh extension. :) Which then leaves you at the mercy of the OS. I find that those who argue loudest for using the Bourne shell as a standard (ignoring the fact that there are actually multiple incompatible sh's under that standard) often do so because they don't know hoe powerful ksh is. : : > It's too bad the POSIX shell group did such a poor job - too much : > infighting from people with vested interests. Personally, I would : > have been perfectly happy had they just said : "We're going to use : > zsh - get over it." : : If they had done that then they would have condemned the POSIX shell to : complete instead of marginal irrelevance, since they would have been : even more widely ignored than they are now. No, all the major vendors would have adopted zsh. : : -rwxr-xr-x 2 bin bin 131072 Apr 12 1999 /usr/bin/sh : text data bss dec hex : 114688 16384 4752 135824 21290 : : -rwxr-xr-x 2 bin bin 270336 Apr 12 1999 /usr/bin/ksh : text data bss dec hex : 229376 40960 17968 288304 46630 : : -rwxr-xr-x 1 root system 917504 Nov 23 1999 /usr/local/bin/zsh : text data bss dec hex : 598016 73728 48896 720640 aff00 On my Linux system, zsh is smaller than bash and much smaller than ksh. I notice you haven't addressed the problem of conflicting "sh" types - in which not even echo works reliably. Dan Mercer : : -- : I've seen things you people can't imagine. Chimneysweeps on fire over the roofs : of London. I've watched kite-strings glitter in the sun at Hyde Park Gate. All : these things will be lost in time, like chalk-paintings in the rain. `-_-' : Time for your nap. | Peter da Silva | Har du kramat din varg, idag? 'U`