Bug in vi or ksh?

hansen at pegasus.UUCP hansen at pegasus.UUCP
Sat Feb 7 15:19:15 AEST 1987


< 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



More information about the Comp.bugs.sys5 mailing list