Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Mar 2003 19:50:51 +0000 (GMT)
From:      Rus Foster <rghf@fsck.me.uk>
To:        Tom Parquette <tparquet@twcny.rr.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Shell scripting questions
Message-ID:  <20030317194718.D38163@thor.65535.net>
In-Reply-To: <3E762419.3040900@twcny.rr.com>
References:  <3E762419.3040900@twcny.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030317194718.D38163>