article

Action executed in 0.000

Human Readable UNIX Commands

Isn't it odd that some UNIX commands like ls and df have options like -h to make the output more human readable? You would think it would be the default! I love open source, but sometimes UNIX just stinks.

So i guess if you omit the -h options, that output is machine readable, facilitating the flow of information from one process to the next. NOPE. In my opinion unix does this very poorly and it's never consistent.

example: When you run ls -l, is it safe to assume that the date starts at character 36 (0 based). It almost alwasy does, but if the file size is over 999,999,999 bytes, then the date starts at character 37.

So you say delimit fields based on space. If your file name has a space in it, then field[7] will only have the first word of it.

If you've ever noticed, the output of many unix commands is tabular. That is there are fields and records. Doesn't it make sense that comma separated fields is the best machine readable output? All unix commands with tabular output should have this option.

In fact i can go so far as to suggest using SQL as an interface to a computer system.

select name, size
from directory
where '2005-10-10' < date
order by size desc
limit 10

Comments

none yet

Post a Comment

* indicates a required field
anonymous (If you want to identify yourself, please sign in first.)
required This field is required.

Max size is 2 MB, aspect ratio 3:4 width:height
required This field is required.
Please include a short description.
required This field is required.

480 characters remaining.
is public

(Use this field if you have to. 3000 characters remaining.)
1 nickel, 2 quarters, 1 penny, 1 dime + 100

Trackback URL

http://derocher.org/~brian//trackback.php?ParentId=2532

form