Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!uwm.edu!lll-winken!ames!pasteur!ucbvax!hplabs!hpfcso!hpfelg!koren From: koren@hpfelg.HP.COM (Steve Koren) Newsgroups: comp.sys.amiga.tech Subject: Re: SKsh completion bug. Message-ID: <13920055@hpfelg.HP.COM> Date: 6 Mar 90 15:22:13 GMT References: <8289@wpi.wpi.edu> Organization: HP Elec. Design Div. -FtCollins Lines: 51 > >Is fixed and will work right in 1.4. Bug in the directory scan code; > >falls under the classification of "programmer stupidity error" :-) > Does this also hold for the 'ls */*'? It makes my amiga guru or, more > brutally, crash without a warning! Yes. It is one and the same bug - just a different symptom. Fixed. Sorry!! The trouble was that if the first wildcard matched a file, SKsh would then look for "file/*", and look for files inside a file. That didn't go over too well with AmigaDos :-). > Also, I have noticed, that SKsh 1.3 will not cooperate correctly with > other programs using (unix-like) wildcards. eg. the simple command > 'Zoo l df1:*' should normally give a list of all files that are zoo-ed > in any file ending with '.zoo' (I seem to make it sound more complicating > than it actually is). But SKsh will make it try to list any file, which > makes zoo terminate on the very first file (eg .info) > Is this fixed in 1.4? Well, it is not really broken. In SKsh (and for that matter, ksh or sh under Un*x), to pass a wildcard to an external program you must quote it. For example: zoo l df1:* (wildcard gets expanded by SKsh, sh, ksh, etc) zoo l 'df1:*' (wildcard gets expanded by zoo) zoo l "df1:*" (wildcard gets expanded by zoo here too) You probably want the 2nd or 3rd example. In the first, SKsh is doing the correct thing from its point of view - it is expanding the wildcard and passing everything matched (ie, every file name) to the program. Un*x usually makes the assumption that it would be redundant for all applications to have their own wildcard matching code - the shell can do it once. The only reasons that many AmigaDos utilities have their own pattern matching code built in are that: 1) the original AmigaDos shell didn't expand wildcards itself, 2) the length of the passed command line is limited to 255 (or so) characters. Thus, if the wildcard matches many files, the line will be truncated. 3) the startup code supplied with Lattice C limits the number of command line arguments to 32. Shell-expanded wildcards are still quite useful. If the last two limitations can be removed or expanded (and they can), they will become even more useful. Hope this helps. Would it be a good idea for me to make this a bit more clear in the docs? I probably didn't describe it very well in there. - steve