I notice in my latest build of FreeBSD 9.0-STABLE (#11), a problem with less and vi with files whose name begins with +. These files occur in /var/db/pkg/(pkg-name)/ For instance, if I cd /var/db/pkg/png-1.4.8 and type less +DESC I get Missing filename ("less --help" for help) but if I type the filename with full path, or even less ./+DESC it works OK I also tried going to /tmp and echo abcdefg > +junk1.txt and the same bug with less showed up (no problem with echo). I tried vi instead of less, not really wanting to edit the file, and vi tried to open a temporary file on /tmp with a strange name. Has anybody noticed this bug? It affects i386 and amd64 at least. I have no access to test on other architectures. If this bug is found, we no doubt want it to be squashed before 9.1-RELEASE. Tom
On Mon, Jul 16, 2012 at 01:03:30AM -0400, Thomas Mueller wrote:> I notice in my latest build of FreeBSD 9.0-STABLE (#11), a problem with less and vi with files whose name begins with +. > > These files occur in /var/db/pkg/(pkg-name)/ > > For instance, if I cd /var/db/pkg/png-1.4.8 > and type > less +DESC > I get > > Missing filename ("less --help" for help) > > but if I type the filename with full path, or even > less ./+DESC > it works OK >less(1) is expecting '+' to be followed by additional arguments. If you use 'less -- +DESC', for example, it should work fine. Same with vi(1). Regards, Glen
On Mon, Jul 16, 2012 at 12:03 AM, Thomas Mueller <mueller23@insightbb.com> wrote:> I notice in my latest build of FreeBSD 9.0-STABLE (#11), a problem with less and vi with files whose name begins with +. > > These files occur in /var/db/pkg/(pkg-name)/ > > For instance, if I cd /var/db/pkg/png-1.4.8 > and type > less +DESC > I get > > Missing filename ("less --help" for help) > > but if I type the filename with full path, or even > less ./+DESC > it works OK > > I also tried going to /tmp and > echo abcdefg > +junk1.txt > and the same bug with less showed up (no problem with echo). > > I tried vi instead of less, not really wanting to edit the file, > and vi tried to open a temporary file on /tmp with a strange name. > > Has anybody noticed this bug? It affects i386 and amd64 at least.It's not a bug... Unix shell regards arguments as same as options, so the command with support + leading options has such a problem.> > I have no access to test on other architectures. > > If this bug is found, we no doubt want it to be squashed before 9.1-RELEASE. > > Tom > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"-- Zhihao Yuan, nickname lichray The best way to predict the future is to invent it. ___________________________________________________ 4BSD -- http://4bsd.biz/
On Mon, Jul 16, 2012 at 01:03:30AM -0400, Thomas Mueller wrote:> I notice in my latest build of FreeBSD 9.0-STABLE (#11), a problem with less and vi with files whose name begins with +. > > These files occur in /var/db/pkg/(pkg-name)/ > > For instance, if I cd /var/db/pkg/png-1.4.8 > and type > less +DESC > I get > > Missing filename ("less --help" for help) > > but if I type the filename with full path, or even > less ./+DESC > it works OK >+ has special meaning in ls: +cmd Causes the specified cmd to be executed each time a new file is examined. For example, +G causes less to initially display each file starting at the end rather than the beginning.> I also tried going to /tmp and > echo abcdefg > +junk1.txt > and the same bug with less showed up (no problem with echo). > > I tried vi instead of less, not really wanting to edit the file, > and vi tried to open a temporary file on /tmp with a strange name. >That's expected. -- Mateusz Guzik <mjguzik gmail.com>
On Jul 15, 2012, at 10:03 PM, Thomas Mueller <mueller23@insightbb.com> wrote:> I notice in my latest build of FreeBSD 9.0-STABLE (#11), a problem with less and vi with files whose name begins with +. > > These files occur in /var/db/pkg/(pkg-name)/ > > For instance, if I cd /var/db/pkg/png-1.4.8 > and type > less +DESC > I get > > Missing filename ("less --help" for help) > > but if I type the filename with full path, or even > less ./+DESC > it works OK > > I also tried going to /tmp and > echo abcdefg > +junk1.txt > and the same bug with less showed up (no problem with echo). > > I tried vi instead of less, not really wanting to edit the file, > and vi tried to open a temporary file on /tmp with a strange name. > > Has anybody noticed this bug? It affects i386 and amd64 at least. > > I have no access to test on other architectures. > > If this bug is found, we no doubt want it to be squashed before 9.1-RELEASE. >Neither of these are "bugs" and I assure you they are as old as the hills (maybe not vi but always vim -- did you recently alias vi to vim?) For less, try this: less +/wheel < /etc/group The + precedes an initial command. Similar with vi[m]. Simple way 'round is to use "--", e.g. below: vi -- +DESC -- Devin _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
On Mon, Jul 16, 2012 at 01:03:30AM -0400 I heard the voice of Thomas Mueller, and lo! it spake thus:> > Has anybody noticed this bug?It's not a bug really; both can take an argument starting with '+' for various things. -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream.
This is not a bug. Both "vi" and "less" have + command line arguements. -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: marka@isc.org
poyopoyo@puripuri.plala.or.jp
2012-Jul-16 05:25 UTC
less and vi fail on file whose name begins with +
At Mon, 16 Jul 2012 01:03:30 -0400, Thomas Mueller wrote:> I tried vi instead of less, not really wanting to edit the file, > and vi tried to open a temporary file on /tmp with a strange name. > > Has anybody noticed this bug? It affects i386 and amd64 at least.You might have received enough replies already but reading manual page is always good thing to understand unix command behaviour. $ man vi | less +/\\+cmd $ man less | less +/\\+cmd No bugs involved here; they both are working as designed. -- kuro
from Glen Barber <gjb@FreeBSD.org>:> less(1) is expecting '+' to be followed by additional arguments.> If you use 'less -- +DESC', for example, it should work fine. Same with > vi(1).Yes, that works, as does "less ./+DESC". Somehow I thought I had successfully done "less +CONTENTS" successfully before, but I must have preceded filename by path. Less and vi failing when used directly on filename beginning with + is also true for Linux, I checked on Slackware 13.0. Thanks to you and others for helpful responses. Tom