On Thu, 21 May 1998, Bruce Bowler wrote:
> As far as I know (and I installed the system and am the only one I know of
> with root access) my /bin/sh is, in fact, /bin/sh. bash doesn't exist on
> this system.
So I fixed an entirely different problem! How about that?
> ls -l and ls -lg both return identical results on my system.
Aha! So that's what's doing it. They don't on mine.
> I'm not an awk programmer so I can't suggest a "simple" fix, but my
> brute-force method would be to change ORS to a space, then run the
> resulting output through awk again, with a simple print $1, something like
>
> user=`echo "$a\n$b" | awk 'BEGIN { ORS=" "} { if ($5 ~ /^[0-9]+$/) print
> $3; }'| awk '{print $1}'`
>
> which, while not pretty, does appear to work on my system.
I'm not an awk programmer either, but I think this is a bit tidier:
user=`echo "$a
$b
" | awk 'BEGIN { OFS=""} { if ($5 ~ /^[0-9]+$/) { print $3; exit; } }'`
group=`echo "$a
$b
" | awk 'BEGIN { OFS=""} { if ($5 ~ /^[0-9]+$/) { print $4; exit; } }'`
[Note: I have left the real newlines in for those who *do* want to have
bash as their /bin/sh.]
1 problem. 2 bugs fixed. I reckon that makes my Efficiency 200% :-)
--
Philip Hazel University Computing Service,
ph10@??? New Museums Site, Cambridge CB2 3QG,
P.Hazel@??? England. Phone: +44 1223 334714
--
*** Exim information can be found at
http://www.exim.org/ ***