Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!xanth!mcnc!gatech!udel!rochester!pt.cs.cmu.edu!cadre!pitt!amanue!oglvee!norm From: norm@oglvee.UUCP (Norman Joseph) Newsgroups: comp.unix.questions Subject: Re: why does -vi- set the hi bit when expanding `%' and `#'? Message-ID: <450@oglvee.UUCP> Date: 9 Jan 89 14:45:57 GMT References: <8700002@gistdev> Organization: Oglevee Computer Systems, Connellsville, Pa Lines: 43 From article <8700002@gistdev>, by dlp@gistdev.UUCP: > => oglvee.UUCP!norm says: > => I am editing a file with vi (say `file.c'), and I want to > => print it without leaving the editor, so I escape to the command > => line by hitting `:' and I type `` :!lp % ''. > > Just out of curiousity, why don't you just `` :w !lp '' ? I assume > your `lp` reads stdin if there are no filename arguments. You are the second poster to suggest this approach to me, and to be honest, it never occurred to me (even though I use the related command `` :r ! ''). This approach works on my system, and I may never need to use the `%' macro again (except when I want to use a command that -doesn't- read from stdin!). I thank both you and the other poster (fcival!dac) for the suggestion. Good, so now I've learned a new vi trick, but I -haven't- learned why vi sets extra bits in the characters of the file name when expanding the `%' and `#' file name macros, which was the intent of my original posting. In article <15219@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: > vi believes that by setting bit 7, it is quoting the file name, > so that if you are editing the file `foo*bar.c', the command > > !echo % > > produces > > !echo \f\o\o\*\b\a\r\.\c > > in shell-internal-quoting format (bit 7 set). Maybe I'm just thick, or maybe I was home sick the day they explained ``shell-internal-quoting format'' to everyone, but would some kind soul who knows what Chris is talking about care to fill me in? (E-mail would be fine. I'm sure people are falling asleep even as we speak :^). Is this the same as quoting sh meta-characters with '\'? Is this something I need to care about beyond being curious? -- Norm Joseph - Oglevee Computer System, Inc. UUCP: ...!{pitt,cgh}!amanue!oglvee!norm "Mate, that parrot wouldn't *VROOM* if you put four million volts through it!"