|Don't ask to ask, just ask|
A little golf anyone?by deprecated (Priest)
|on Oct 30, 2002 at 20:00 UTC||Need Help??|
I am finding myself irritated by solaris 8's lack of du and df -h. Especially now that solaris 9 actually has the flag. So I am preparing to write a small shell one-liner or perl if I cant do it with awk or sed (the principle being, if youre going to do it a bunch of times, you want it to be fast).
So the challenge is:
Replicate the output of a du or df with the -h flag. Example:
Replicate it in such a way that it can be passed input from standard in.
Special note: if you can do it in sed or some other shell command (ideally a common one, let's not be linux or solaris or bsd centric here), that is fine, given the intent is to have a working shell alias. Contestants will be judged from the first character after the pipe:
So, yeah, that means you get a 1 character bonus for using sed, but I doubt your command would be as compact.
Consider it a Unix "brown bag" golf. Enjoy!