[ale] I have a single shell command complex syntax winner

Michael B. Trausch mike at trausch.us
Wed Jan 26 12:19:57 EST 2011


On Wed, 2011-01-26 at 11:25 -0500, Greg Freemyer wrote:
> I thought I spoke command line pretty well, but on another list I just
> saw:
> 
> dcfldd bs=32k conv=noerror,sync sizeprobe=if if=/dev/sda
> of:='ewfacquirestream -c fast -d sha1 -D MAC20 -M physical -S 2000000
> -l "/media/HD-PVU2/MAC20/MAC20.log.txt.hashes" -t
> "/media/HD-PVU2/MAC20/MAC20" 2> /dev/null > /dev/null' errlog:='tee -a
> "/media/HD-PVU2/MAC20/MAC20.log.txt" > /dev/null' hashlog:='tee -a
> "/media/HD-PVU2/MAC20/MAC20.log.txt.hashes" > /dev/null'
> 
> That is one hard to parse statement, at least for me.  I think it
> launches 4 program instances without any of the normal connectors

At one point, I used to be very much in the habit of constructing
exceedingly complex command lines.  At a previous employer, we used many
different types of (authentic) UNIX and (other) UNIX-like systems, but
there was one rule that held true for all of them:  We (the support
people) were not allowed to put shell scripts on the systems---not even
in our home directories.  The reason that we were given was because
"that would alter the platform in a non-change-controlled way".
Personally that sounded like (hell, still does) a crock of crap.  But,
we weren't allowed.

So, to get around that, I would build one-liners.  The "parameters" to
the one-liners were shell variables.  I'd kept a text file on my laptop
that had the one-liners, a description of their inputs, and a
description of their outputs, if there was indeed any output.  The most
complex one started several (don't recall exactly how many) subshells
and had many pipes both in and between the subshells.  It was rather
nice to be able to paste in decaline-long commands and get something
done in a decisecond that previously took 20 minutes or more to do
manually.

I'd taken to building these one liners, and then after I'd tested them
sufficiently, I'd rewrite them as a well-formatted shell script that I
would put in the developers' ticket queue, in the hopes that they would
adopt the use of those shell scripts so that _everyone_ could benefit
from the scripts.  Sadly, that never happened.  Oh, well.

I am also pretty sure that if I still had a copy of those commands handy
that I would probably have to spend 45 minutes or more going through
them to figure out what they did.  Most of them were very specific to
AT&T SVR4 systems, and I quickly realized that I could not do my testing
on Linux, even after installing pdksh, because many of the core commands
had slightly different output formats, and the custom commands that were
on the systems did not exist, of course.

	--- Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://mail.ale.org/pipermail/ale/attachments/20110126/e2d4c371/attachment.bin 


More information about the Ale mailing list