From: ccam@spiral2.its.latrobe.edu.au (Andrew Moar)
Subject: Re: Need a UNIX expert to create a new UNIX command
Date: 2000/06/07 [thread overview]
Message-ID: <8hkgmh$dtc$1@news.latrobe.edu.au> (raw)
In-Reply-To: 8his5s$ing$1@miranda.gmrc.gecm.com
In article <8his5s$ing$1@miranda.gmrc.gecm.com>,
jxb@unconfigured.xvnews.domain (Jocelyn Burget) writes:
> I'd like to create a command, let's call it "diskfull", that does
> exactly the same thing as du but the output will be in my own format.
>
> Example:
>
> [nautilus:jxb] 11% diskfull -M filename
> Result: The reported occupied space is in Mbytes
>
> OR
>
> [nautilus:jxb] 11% diskfull -G filename
> Result: The reported occupied space is in Gbytes
How about something like:
#!/bin/sh
if [ "$1" = "-M" ]
then
du -k $2 | awk '{print ($1 / 1024) " " $2}'
else
du -k $2 | awk '{print ($1 / 1048576) " " $2}'
fi
or something along those lines...
Cheers,
Andrew
--
Andrew Moar : Ph +61 3 9479 1505 email A.Moar@latrobe.edu.au
Unix Environment Specialist, Information Technology Services
La Trobe University, Bundoora
next prev parent reply other threads:[~2000-06-07 4:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-06 4:00 Need a UNIX expert to create a new UNIX command Jocelyn Burget
2000-06-07 4:00 ` Andrew Moar [this message]
2000-06-07 4:00 ` Joerg Bruehe
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox