From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 24 11:40:21 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86C36106564A for ; Sun, 24 Jul 2011 11:40:21 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by mx1.freebsd.org (Postfix) with ESMTP id 156F68FC12 for ; Sun, 24 Jul 2011 11:40:20 +0000 (UTC) Received: by fxe6 with SMTP id 6so5682655fxe.17 for ; Sun, 24 Jul 2011 04:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=Qb35ls7El1/d8laF92luLeKnY/n1KxPjysNwOf31B7k=; b=UIFAtobrFK1Kir5JCiCFBQ3e2U8a9MNsCZwiK3TAvQ7VG05qPhkgvrhVOqevNHtilE lxU4SqMD2fjMYlZqED1aizlbH1+WJF92dYeb8pn1Sk443/hk9qhvXx1aaIrYOMn86vlb BFXxWfnApf7xFUinwQDxEiS7LfZOe6L859tZY= Received: by 10.204.30.202 with SMTP id v10mr1019888bkc.268.1311507619988; Sun, 24 Jul 2011 04:40:19 -0700 (PDT) Received: from [192.168.119.14] (gate19.robnet.pl [194.105.132.219]) by mx.google.com with ESMTPS id q1sm750843faa.3.2011.07.24.04.40.17 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 24 Jul 2011 04:40:18 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <86hb6e1bau.fsf@gmail.com> Date: Sun, 24 Jul 2011 13:40:15 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <589EB85A-1902-4643-A1FD-3C98445127DB@freebsd.org> References: <0CEA161B-6767-4379-B923-585B3D4EA74E@freebsd.org> <86hb6e1bau.fsf@gmail.com> To: Test Rat X-Mailer: Apple Mail (2.1244.3) Cc: freebsd-hackers@freebsd.org Subject: Re: Autosizing column widths in ps(1). X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 11:40:21 -0000 Wiadomo=B6=E6 napisana przez Test Rat w dniu 22 lip 2011, o godz. 19:21: > Edward Tomasz Napiera=B3a writes: >=20 >> Patch below changes ps(1) to automatically size column widths = according to their >> contents. =46rom the user point of view, it prevents breaking layout = with too wide values >> and in most cases makes output narrower. =46rom the developer point = of view, it removes >> the need to specify widths. Testing is welcome - the patch shouldn't = change ps(1) >> behaviour except slightly changing the widths, but the code changes = are pretty large >> and it's quite possible I've missed something. >=20 > STAT column seems to be right-aligned when it was previously = left-aligned. > This makes sorting it harder, e.g. >=20 > $ ps ax | (IFS=3D; read h; echo $h; sort -k3) | less Good catch, thanks! Updated patch, which also fixes two issues = affecting TTY column, is at http://people.freebsd.org/~trasz/ps-9.diff. -- If you cut off my head, what would I say? Me and my head, or me and my = body?