<div dir="ltr"><div dir="ltr">On Sun, Sep 15, 2019 at 5:17 AM K K Subbu <<a href="mailto:kksubbu.ml@gmail.com">kksubbu.ml@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 13/09/19 2:04 AM, tim Rowledge wrote:<br>
> WHOAMI=`whoami`<br>
><br>
> echo creating rotated log/main directory...<br>
> mkdir -p log/main<br>
> chmod o-rwx log/main<br>
> <br>
> echo --- generate log/run script<br>
> echo ''#!/bin/bash<br>
> exec 2>&1<br>
> exec setuidgid ''$WHOAMI'' multilog t ./main'' > $PWD/log/run<br>
> sudo chown -R $WHOAMI log<br>
<br>
WHOAMI is local to the script, so it won't be set in the run script <br></blockquote><div><br></div><div>Correct.  It's for the installation script only.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
leading to multilog being treated as a uid argument.</blockquote><div><br></div><div>My undestanding is that Tim's fix, to put double-quotations around it, will cause "$WHOAMI" to resolve during the run of this installation script, hardcoding the current user as the uid argument.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
You could change this to the more readable:<br>
<br>
echo -- generate log/run script<br>
cat >$PWD/log/run <<EOF<br>
#!/bin/bash<br>
exec 2>&1<br>
exec setuidgid $WHOAMI multilog t ./main<br>
EOF<br>
sudo chown -R $WHOAMI log<br></blockquote><div><br></div><div>Thanks!</div><div><br></div><div>  - Chris</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
HTH .. Subbu<br>
</blockquote></div></div>