Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Bourne / bash problem
- Date: Mon, 27 Apr 2009 02:08:51 +0100
- From: Josh Glover <jmglov@example.com>
- Subject: Re: [tlug] Bourne / bash problem
- References: <c0f4e2b00904040115k14c6f9dcma0448e9904c8fd2f@example.com> <20090406002524.add5eb5f.sl-tlug@example.com> <ed10ee420904260249u4d397f84u80a6eac7a3301a05@example.com> <78d7dd350904260710y294ccdd9w10d1333e424f6b4a@example.com>
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. > 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. > 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? Have you read many man pages for standard binutils recently? How about shell built-ins? How about GNU utilities that don't even have man pages but rather some brain-dead thing called info? Do you remember what this does? cp -dipRux foo bar or would you like a comment? When writing shell scripts, you (by definition) have no control over the options the programs you are calling require. If you use Perl, sure, you can build the command one crazy option at a time, and do something "readable" like this: my %cp_option_for = ; my $cp_src = 'foo'; my $cp_dst = 'bar'; my $cmd = 'cp -' . values(%{ no_dereference_preserve_links => 'd', interactive => 'i', preserve_mode_ownership_timestamps => 'p', recursive => 'R', update => 'u', one_file_system => 'x', }) . " $cp_src $cp_dst" ; unless (0 == system $cmd) { ... } -- Cheers, Josh
- Follow-Ups:
- Re: [tlug] Bourne / bash problem
- From: Nguyen Vu Hung
- Re: [tlug] Bourne / bash problem
- From: Stephen J. Turnbull
- References:
- [tlug] Bourne / bash problem
- From: Bruno Raoult
- Re: [tlug] Bourne / bash problem
- From: Stephen Lee
- Re: [tlug] Bourne / bash problem
- From: SL Baur
- Re: [tlug] Bourne / bash problem
- From: Nguyen Vu Hung
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Two keyboards, two layouts: udev likely part of the solution
- Next by Date: Re: [tlug] Bourne / bash problem
- Previous by thread: Re: [tlug] Bourne / bash problem
- Next by thread: Re: [tlug] Bourne / bash problem
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links