[prog] Shell question...
John Clarke
johnc+linuxchix at kirriwa.net
Sat Dec 11 10:19:08 EST 2004
On Fri, Dec 10, 2004 at 06:28:13 +0100, Riccarda Cassini wrote:
> On Fri, Dec 10, 2004 at 06:16:21PM +1100, John Clarke wrote:
> >
> > eval `echo bla blah blurb | while read FOO BAR BAZ; do echo FOO=$FOO; echo BAR=$BAR; echo BAZ=$BAZ; done `
>
> Nice idea, that eval :-)
Thanks.
> I first checked whether I do have backup copies of the scripts...
> I'm not the ubergeek I'd like to be. Not yet ;-)
Keeping backups doesn't mean you're not an ubergeek.
> Neat. Thanks a lot!!
You're welcome.
> Just out of curiosity, does anyone have an idea why all this isn't
> needed on HP-UX? What surprises me most is that it doesn't seem to
> depend on the shell (ksh), but rather on the OS...
I can't help you with that one. Fortunately I've been spared any
exposure to HP-UX, and the signmonster agrees.
> eval `echo bl\\\\\\\\\"a | ./read_vars.sh FOO`
You have way too much time on your hands :-)
You can remove eight of those backslashes, if you change this line in
read_vars.sh:
echo "$1=\"$VALUE\""
to this:
echo "$1='$VALUE'"
And I'm allowed to have way too much time on my hands today, it's
Saturday and I don't have to work :-) Well, not much anyway.
Cheers,
John
--
"HPUX" and "sane" have never been uttered in the same sentence
without accompanying negatives.
-- Richard Henderson
More information about the Programming
mailing list