Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!husc6!mit-eddie!genrad!decvax!tektronix!teklds!cae780!leadsv!esl!mac From: mac@esl.UUCP Newsgroups: net.unix-wizards Subject: Re: 'vi +/mail .login' not on SUN ?? - (nf) Message-ID: <333@esl.UUCP> Date: Tue, 28-Oct-86 21:19:04 EST Article-I.D.: esl.333 Posted: Tue Oct 28 21:19:04 1986 Date-Received: Wed, 29-Oct-86 22:03:00 EST References: <38400002@pbinfo.UUCP> <732@mips.UUCP> Reply-To: mac@esl.UUCP (Mike McNamara) Organization: ESL, Inc., Sunnyvale, CA. Lines: 47 In article <732@mips.UUCP> dce@mips.UUCP (David Elliott) writes: >In article <38400002@pbinfo.UUCP> michael@pbinfo.UUCP writes: >> >> What is wrong? >> >>I tried on a SUN 3 to invoke the 'vi' (only for fun(:-) with >>the command >> >> vi +/mail .login >> >>which should (I think) bring up 'vi' with my .login and place >>me to the first occurrence of the word "mail". Surprise!! It >>said something like 'hit bottom without finding matching pattern', >>although this word is definitively in my .login. (I invoked 'vi' >>with 'vi .login' and did a '/mail', worked perfect.) I fiddled a >>little with " and ', but the result remained the same. >> >> So, who is wrong: The SUN or I ?? >> >> Michael Schmidt > > >When the '+/mail' command is executed, the editor is in 'ex' mode. That >is, it's the same as having executed ex on the file and typing the command >/mail. Now, when the editor starts up in ex mode, the current line is >at the end of the file, so the search starts there. If the option >nowrapscan is set, the search will stop (with the 'hit bottom' message >if nothing is found) at the bottom of the file. > > vi '+1;/pattern' file > > David Elliott > decwrl!mips!dce Or vi +\?mail .login (if all he wanted was a line with mail, rather than the First line with mail. Saves 3 characters (note the ; requires the ''s) -- ------------------------------------+-----------------------------------------+ | Michael Mc Namara | MM MM MM OO SSS AAA II CCCC | | ESL Incorporated | M M M O O S A I C C | | ARPA: mac%esl.UUCP@ames.ARPA | M M M O O SSS AAAA I C | | mac%esl.UUCP@shasta.ARPA | M M M O O S A A I C C | | mac%esl.UUCP@lll-lcc.ARPA | MM M M OO SSS AAA A III CCCC | ------------------------------------+-----------------------------------------+ | Note: esl used to be called tflop; the path mac%tflop will still work awhile| ------------------------------------+-----------------------------------------+