Date: Wed, 29 May 2002 01:18:38 -0700 From: "Philip J. Koenig" <pjklist@ekahuna.com> To: questions@FreeBSD.ORG Cc: Roman Neuhauser <neuhauser@bellavista.cz> Subject: Re: grep and console width Message-ID: <20020529081837454.AAA467@empty1.ekahuna.com@pc02.ekahuna.com> In-Reply-To: <20020529074726.GA18367@freepuppy.bellavista.cz> References: <20020529073941327.AAA467@empty1.ekahuna.com@pc02.ekahuna.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 29 May 2002, at 9:47, Roman Neuhauser boldly uttered: > > From: "Philip J. Koenig" <pjklist@ekahuna.com> > > Date: Wed, 29 May 2002 00:39:42 -0700 > > > > I was shocked to discover today that the "grep" command is impacted > > by the width of a console window. [snip] > > But when I use: > > ps -aux |grep <daemon name string> > > > > It doesn't return anything! But if I change the console size from 80 > > columns to 132 columns, poof, grep now returns the match! > > > > So does the size of the display really change whether grep knows > > about the output of a command?!? > > No. It's not grep, it's ps(1). see the w option. Wow, so it is. So even if you redirect the output of that command, and it never even touches a console window, it formats the output to fit the current console window? (or defaults to 80 chars) Learn something new every day... thanks! Is this common behaviour outside of ps? (On a somewhat related note, I found recently that occasionally in certain programs, ie mutt, text *appears* to be formatted for 80 cols, but wraps anyway. IE with the help file in mutt (older version that needs to be upgraded) there appears to be an "indent" on the left side of the text that causes this. I have to set the console to 132 cols to make it readable) Phil -- Philip J. Koenig pjklist@ekahuna.com Electric Kahuna Systems -- Computers & Communications for the New Millenium To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020529081837454.AAA467>