From owner-freebsd-questions Mon Mar 17 11:50:49 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DE7BD37B401 for ; Mon, 17 Mar 2003 11:50:47 -0800 (PST) Received: from thor.65535.net (thor.65535.net [65.214.160.96]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1D5B43F3F for ; Mon, 17 Mar 2003 11:50:46 -0800 (PST) (envelope-from rghf@fsck.me.uk) Received: from localhost (thor [65.214.160.96]) by thor.65535.net (8.12.6/8.12.6) with ESMTP id h2HJopRa070049; Mon, 17 Mar 2003 19:50:51 GMT (envelope-from rghf@fsck.me.uk) Date: Mon, 17 Mar 2003 19:50:51 +0000 (GMT) From: Rus Foster To: Tom Parquette Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Shell scripting questions In-Reply-To: <3E762419.3040900@twcny.rr.com> Message-ID: <20030317194718.D38163@thor.65535.net> References: <3E762419.3040900@twcny.rr.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Mon, 17 Mar 2003, Tom Parquette wrote: > The closest I can come to determining the size of the output file from > tar (e.g.ad0s1a.tgz) is: file_size=`du -k /tmp/ad0s1a.tgz`. You can get just the first coloumn of something by doing something like du -k /tmp/ad0s1a.tgz | awk '{ print $1 }'. That should help you a bit for that > 2) I have a function written that will tar/gzip the filesystem then > split it into pieces that will be turned into .iso files that will be > fed to burncd. I would like to capture the output of commands (e.g. ls > -l /tmp/ad0s1a.*) into a "table" that I can examine to determine what > was output by the split command so I know what mkisofs commands, and how Could you do something like for i in /tmp/ad0s1a.tgz.?? ; do mkiosfs ..... ; done > I also hope to use the same technique for determining what filesystems > I have to backup in the first place. e.g. If I do a df command I want > to pull out the filesystem name and what mountpoint it is on. The You might have slightly nicer format if you use just the "mount" command on its own. If you couple it with the awk command say mount | awk '{ print $1,$2 }' Play have fun :) Rgds Rus -- http://www.65535.net | MSN: support@65535.net | e: rghf@65535.net "More bits for your bite" Lifetime FreeBSD + Linux Hosting and Shell Accounts Please respect RFC1855 and don't top post To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message