From owner-cvs-src@FreeBSD.ORG Mon Dec 15 00:37:21 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3DEDB16A4CE; Mon, 15 Dec 2003 00:37:21 -0800 (PST) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FFBD43D36; Mon, 15 Dec 2003 00:37:16 -0800 (PST) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])hBF8bBD8028245; Mon, 15 Dec 2003 19:37:11 +1100 (EST) (envelope-from jeremyp@cirb503493.alcatel.com.au) Received: (from jeremyp@localhost)hBF8b4ob028244; Mon, 15 Dec 2003 19:37:04 +1100 (EST) (envelope-from jeremyp) Date: Mon, 15 Dec 2003 19:37:04 +1100 From: Peter Jeremy To: Mark Murray Message-ID: <20031215083703.GB956@cirb503493.alcatel.com.au> References: <200312141136.hBEBa2pD043994@grimreaper.grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200312141136.hBEBa2pD043994@grimreaper.grondar.org> User-Agent: Mutt/1.4.1i cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= cc: src-committers@freebsd.org cc: cvs-all@freebsd.org cc: cvs-src@freebsd.org Subject: Re: cvs commit: src Makefile.inc1 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2003 08:37:21 -0000 On Sun, Dec 14, 2003 at 11:36:02AM +0000, Mark Murray wrote: >Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= writes: >> It uses Perl directly to compute the numeric mode of a file. The >> version in -CURRENT uses a combination of stat(1), bc(1) and shell >> arithmetic which causes a syntax error in 4.x. >> >> Personally, I think it would be best if stat(1) could gain an option >> (-m perhaps) that makes it simply print its arguments' modes in octal. > >Does 4.x's stat(1) have the "-s" switch? If so: > >$ ( eval $(stat -s .profile) ; printf "%o %s\n" ${st_mode} ${st_mode} ) >100644 0100644 > >Would that be any use? Not in the absence of stat(1) :-(. As an alternative, maybe ls(1) could grow an option to spit out the mode in octal - assuming there are any spare opton letters left. The simplest solution would seem to be to MFC stat(1) to 4.x. The only other alternative would be a (messy) awk script to convert the mode letters in 'ls -l' output to an octal number. Peter