Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!pegasus!hansen From: hansen@pegasus.UUCP Newsgroups: comp.bugs.sys5 Subject: Re: Bug in vi or ksh? Message-ID: <2938@pegasus.UUCP> Date: Sat, 7-Feb-87 00:19:15 EST Article-I.D.: pegasus.2938 Posted: Sat Feb 7 00:19:15 1987 Date-Received: Sun, 8-Feb-87 05:30:08 EST References: <2063@ptsfa.UUCP> <497@custom.UUCP> Reply-To: hansen@pegasus.UUCP (60021254-Tony L. Hansen;LZ 3B-315;6243) Distribution: na Organization: AT&T-IS Labs, Lincroft, NJ Lines: 26 Keywords: ksh, vi, UNIX Summary: why vi did this < the '%' meta-character is expanded. Csh and sh strip < the data to 7-bit ASCII and hence there is no problem. < Ksh doesn't, hence the lookup fails. < < This was one of the things we noticed when we did PC/VI, but < couldn't figure out any good reasons why VI did this. (I let this question go unanswered for a while waiting for someone else to answer first. Since no one has that I've seen, I will.) When the old Bourne/C shell saw an argument with the eighth bit set, it would treat the character as if it were hard-quoted and strip the 8th bit. Hard quoting normally comes from prefixing characters with \ or using ' around them. Vi always turned on the 8th bit for all arguments so that all file names would get passed to the shell as if they were quoted, so that characters within the name couldn't possibly be interpreted as shell metacharacters. This way, you can edit a file named "xyz*abc" and not have the "*" expanded when you use '%' on a ! command. Note that the System V release 3 Bourne shell, as well as the Korn shell, no longer does the 8th-bit stripping. Tony Hansen ihnp4!pegasus!hansen