From owner-freebsd-questions Wed May 29 1:18:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from empty1.ekahuna.com (empty1.ekahuna.com [198.144.200.196]) by hub.freebsd.org (Postfix) with ESMTP id 2FE8337B400 for ; Wed, 29 May 2002 01:18:41 -0700 (PDT) Received: from pc-02 (pc02.ekahuna.com [198.144.200.197]) by empty1.ekahuna.com (Post.Office MTA v3.5.3 release 223 ID# 0-0U10L2S100V35) with ESMTP id com; Wed, 29 May 2002 01:18:37 -0700 From: "Philip J. Koenig" Organization: The Electric Kahuna Organization To: questions@FreeBSD.ORG Date: Wed, 29 May 2002 01:18:38 -0700 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: grep and console width Reply-To: pjklist@ekahuna.com Cc: Roman Neuhauser In-reply-to: <20020529074726.GA18367@freepuppy.bellavista.cz> References: <20020529073941327.AAA467@empty1.ekahuna.com@pc02.ekahuna.com> X-mailer: Pegasus Mail for Win32 (v3.12c) Message-ID: <20020529081837454.AAA467@empty1.ekahuna.com@pc02.ekahuna.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 29 May 2002, at 9:47, Roman Neuhauser boldly uttered: > > From: "Philip J. Koenig" > > 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 > > > > 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