Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Bourne / bash problem



On Mon, Apr 27, 2009 at 8:08 AM, Josh Glover <jmglov@example.com> wrote:
> 2009/4/26 Nguyen Vu Hung <vuhung16plus@example.com>:
>
>> The OP limited himself doing brain surgery with a hammer,
>
> Maybe, and maybe not. If you want to tie a bunch of tools together in
> a pipeline but want to save yourself some typing (or shell history
> searching), a shell script is much more suited for the job than Perl
> or Python.
As said in the first post, the those options were used by ffmpeg, for example.
He want to convert some movie format but he can't remember all the options,
that's why he tried putting all the options into a (bash script).
However, in addition,
he wanted those options to be easy to understand.

I man'ed ffmpeg and most of the options are explained as:

  -f fmt
           Force format.

So to figure out what the -f is (isn't it --format better?), one has
to write a explantion, which is a bad
documentation writing habit.

>
>> With scripting languages like Perl or Python, we can have
>> same effect and readable code.
>
> For certain classes of problems, sure. For the standard UNIX idiom of
> piping 13 commands together, I'd argue that a shell script is much
> more readable.
I would like replace "readable" with "easy to understand" or "self explained"
in the previous email of mine.

>
>> IMO, most of the options
>> are self explained, right? Or they should be. So the comments like that
>> won't be necessary, at least for me as I can read and write English :D
>
> Are you kidding me?
No, I am totally serious.

> Have you read many man pages for standard binutils
> recently?
I love binutils but,

> How about shell built-ins?
I hate (binutils's) built-in commands.

> How about GNU utilities that
> don't even have man pages but rather some brain-dead thing called
> info?
Do anyone care to explain why GNU utilities do separates its manuals
into "a command --help", "man command", and "info command"?

>
> Do you remember what this does?
>
> cp -dipRux foo bar
If one want to suicide and wall the world about it,

$sudo rm --force --recursive /

will be much "readable" than

#rm -rf /

Most GNU tools have short form and long forms of options,
which are good programming habits. Some tools like ffmpeg doesn't.

>
> or would you like a comment?
getopt does the work but not for lazy programmers.






-- 
Best Regards,
Nguyen Hung Vu [aka: NVH] ( in Vietnamese: Nguyễn Vũ Hưng )
vuhung16plus{remove}@example.com , YIM: vuhung16 , Skype: vuhung16dg
A brief profile: http://www.hn.is.uec.ac.jp/~vuhung/Nguyen.Vu.Hung.html


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links