From owner-freebsd-newbies Thu Nov 25 6:16:18 1999 Delivered-To: freebsd-newbies@freebsd.org Received: from pau-amma.whistle.com (pau-amma.whistle.com [207.76.205.64]) by hub.freebsd.org (Postfix) with ESMTP id 7841D14BB7 for ; Thu, 25 Nov 1999 06:16:16 -0800 (PST) (envelope-from dhw@whistle.com) Received: (from dhw@localhost) by pau-amma.whistle.com (8.9.2/8.9.2) id GAA02393; Thu, 25 Nov 1999 06:16:12 -0800 (PST) Date: Thu, 25 Nov 1999 06:16:12 -0800 (PST) From: David Wolfskill Message-Id: <199911251416.GAA02393@pau-amma.whistle.com> To: rk@nanoteq.co.za, unknown@riverstyx.net Subject: Re: vi and plus Cc: freebsd-newbies@FreeBSD.ORG In-Reply-To: <19991125023115.A27320@riverstyx.net> Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Date: Thu, 25 Nov 1999 02:31:15 -0800 >From: Tani Hosokawa [This probably ought to have gone to -questions, but I thought it would be better to let the folks who saw the original messages see what I had to say about it. And I've re-ordered some text. dhw] >On Thu, Nov 25, 1999 at 11:23:01AM +0200, Riaan Kruger wrote: >> Is it at all possible to edit a file with vi that start with a plus/"+", >> for example +CONTENTS. The man page says the +whatever is used for some >> kind of command. >Sure.. >vi -- +CONTENTS >Works for me. Generally, you can use -- to specify the end of flags, ie. >rm -- -filename >normally rm would treat -filename as some kind of argment, like vi does with +. Actually, the use of "--" in that way has but recently (within the last 8 years or so, mostly from FSF/GNU influence) become rather fashionable. A more general solution (that doesn't depend on that particular method of parsing the command-line) is to refer to the file by prefixing the filename with "./" -- thus: vi ./+CONTENTS (That is, it's "more general" in that it works for any program, whether or not it is sensitive to seeing "--" in the command-line. It also copes with filenames that begin with "-" as well. It is "less general" in the sense that it only works for command-line arguments that correspond to filenames.) Cheers, david -- David Wolfskill dhw@whistle.com UNIX System Administrator voice: (650) 577-7158 pager: (888) 347-0197 FAX: (650) 372-5915 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message