Re: Why questions don't get answered, or "No, I've already RTFM, tell me the answer!"

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

 



Mike McCarty wrote:



Which is why, my friends, when I need a quickie one-off I
*never* write a script. My longest scripts are no more than
20 lines or so. As soon as I need an "if" I switch to C
and write in a language which is documented, understandable, and
portable between systems.

When I left the IBM mainframe world in 1981 I left JCL behind,
You could have been using Jol, which is much nicer.

In the early 70s I wrote a set of assembler macros to generate JCL (similar to sysgen). Way better than catalogued procedures.

My boss thought it a great joke when I submitted a job that submitted 50 or so jobs to copy tapes, then went off to college. It seems the computer centre staff got excited at having to do some work, and he took the call.

You could also have bene using TSO command procedures. Note to others; imagine JCL as assembler-like, and TSO (with MVS, before MVS was different) command procedures as akin to a well-structured third-generation language compled with do/end blocks. Statements looked like this:
allocate file(fred) dataset(good.stuff) new -
   space (1000 100) block(4096) round


and have never looked back. Writing long involved scripts is
a throw-back to the Jurassic age. Join the 21st Century and
abandon shell scripts.

Just my $0.02 worth.
Way overpriced.

How many lines of C is this worth:
for f in $(find unix/ common/ -type f -name \*.h -o -name \*.cxx  \
|xargs grep -lw secTypeVncAuth); do vim -c /secTypeVncAuth $f; done

That's the sort of thing I type at the commandline.

How long would this take in C?
[summer@bilby ~]$ cat bin/cleanaustin | expand -t 3
#!/bin/bash
U=http://dugite/~summer/vendors/www.austin.net.au/components.html
lynx -source ${U}                                           \
   | grep -v cgi3                                           \
   | tr '\t\r\n!'       '   '                               \
   | tr "']"               '"#'                             \
   | (
      sed                                                   \
       -e 's=</html>.*=='                          \
       -e 's~.*<BODY[-a-zA-Z0-9 ;"=_)(,]*~@@~'           \
       -e 's=@@.*&amp; availability==g'                     \
       -e 's=&nbsp;= =g'                                    \
       -e 's=&amp;=and=g'                                   \
       -e 's=&quot;="=g'                                    \
       -e 's=</tr>=|=g'                                     \
       -e 's=</td>=!=g'                                     \
       -e 's~<[-A-Za-z0-9 "/#%@_?\*\#=.]*>~~g'              \
       -e 's=   *= =g'                                      \
       -e 's=[ |!]| *=|=g'                                  \

      )                                                     \
   | tr '|!' '\n\t'

It did a passable (better than lynx) job of cleaning up a web page, making it readable.


There is and will be for the foreseeable future, a place for scripts, for light programming tasks and for glueing stuff together.

It's way easier to read /sbin/dhclient-script and discover what it does than it is to locate, download (maybe), install and patch (maybe) the source to /sbin/dhclient find what _it_ does.

I've been through the process of debugging vendor-provided scripts (eg debmirror) and vendor-provided binaries (cyrus-imapd), and the edit and rerun process for the former beats the edit, rebuild, copy and reinstall of the latter.




--

Cheers
John

-- spambait
1aaaaaaa@xxxxxxxxxxxxxxxxxxxxxxx  Z1aaaaaaa@xxxxxxxxxxxxxxxxxxxxxxx
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/

do not reply off-list


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux