[PLUG] Any shell script wizards in da hizzy?

Damon Getsman damo.gets at gmail.com
Wed Dec 3 15:25:31 UTC 2014


>
> Date: Fri, 28 Nov 2014 15:26:18 -0800
> From: "Martin A. Brown" <martin at linux-ip.net>
> Subject: Re: [PLUG] Any shell script wizards in da hizzy?
>


> > Just curious as to whether or not there might be anyone in the
> > mailing list here that is pretty good with quasi-complex /bin/sh
> > scripting.
>
> Yes, there are a few shell monsters lurking in this cavern.  Perhaps
> they wish to remain in the shadows....I do not know.
>

  I did manage to get a private email from somebody whom I've been
procrastinating on getting a more detailed response to here, actually.  :)
 I suppose it's probably for the best, as it's being implemented primarily
on a non-Linux machine.


> > I'm trying to keep what I'm working on as portable as
> > possible, and down to the lowest common denominator for any UNIX
> > system, not just linux, so I'm pared down a bit even from general
> > bash scripting ability.
>
> Scripts that are ultimately portable end up looking to me (for
> obvious reasons) like every ./configure script out there.
>

  Yeah, I've noticed that in my last few...  It's kind of horrible, but
what else can you do?  I need to learn to do some pretty in-depth,
intermittently interactive shell scripts for my system's headless crash
recovery system, anyway, so I might as well start diving in all over the
place.  ;)


> > I've got a problem involving some dynamic command line creation
> > issues with (at least in the solution that I've come up with for
> > it as to this point) heavily recursive quoting involved.
>
> Sounds like the usual sort of ugly when you can't use the features
> of bash, zsh or even a proper language/library.
>

  Well, I'm not sure, I may well not be handling things as easily as they
could be.  I've done some bits with /bin/sh, ksh, bash, and tcsh in my
time, but none of them have gone anything past very, very rudimentary
sed/awk calls in them.  I still have to pull up the man page or tutorials
for all kinds of expansion and keyword issues; my guess is that I'm missing
some huge efficiency improvements and probably a lot that could be
simplified more.


> > If anybody knows a bit about quoting and string expansion in
> > /bin/sh, I'll post a bit for troubleshooting, if anyone would care
> > to lend a hand.
>
> Be cautious, lest you be bitten by a some dreadful non-POSIX beast.
>
> They are, however, so alluring....
>

  *grin*  At least I've been able to stay away from Solaris & CentOS for
almost a decade now. *braces for the religious wars*
  Best wishes.

  -Damo



More information about the PLUG mailing list