Reindl Harald wrote: > > schrieb LuKreme: > >Bob Proulx wrote: > > > The syntax "variable=value command" is a /bin/sh syntax which sets the > > > variable for just that command. In the above sa-update would get the > > > PATH setting. But then && terminates that command. > > > > I’m actually not positive that is the case. The && syntax chains > > the commands into a dependent chain (sa-update only triggers if ... > > the && does nothing than start one command only if the following with a 0 > return value and that's it - no other magic involved
Right. The '&&' creates a "dependent chain" just as LuKreme said and you both say. But the point here is that the '&&' is just like ';' in that it terminates the previous command. And therefore the 'variable=value command1 && command2' affects only command1 and not command2. Since command2 is a separate command it does not get the variable=value assignment. > did you look on top of the crontab? > > normally there is PATH set and so if you install stuff to /usr/local it's > likely a good ide to have it in PATH too > > [root@srv-rhsoft:~]$ cat /etc/crontab > SHELL=/usr/bin/bash > PATH=/usr/bin:/usr/sbin That value there affects only the /etc/crontab. It won't change the value of PATH for any of the other users or crontabs. The above sets it for /etc/crontab only and all of the processes spawned from there. Since /etc/crontab usually starts run-parts for /etc/cron.daily and /etc/cron.weekly and /etc/cron.monthly then those script directories also inherit the environment settings from /etc/crontab. But other crontabs do not. Changing that PATH will not help LuKreme who is using an AT&T style '# crontab -l' /var/spool/cron/crontabs/root. The /etc/crontab is the BSD root crontab. /var/spool/crontab is the AT&T crontab. The /etc/cron.d is Vixie's crontab. vixie-cron supports all three locations and the handles the syntax differences between them transparently. Seeing SHELL=/usr/bin/bash I must comment that the setting is quite unusual. It would normally be /bin/sh. Or on some systems be /bin/bash. It is quite unusual to see /usr/bin/bash there. Bob