Consider the following anacrontab file:
1 0 bob-job /home/bob/script.sh
I know I can set variables like this:
FOO=bar
1 0 bob-job /home/bob/script.sh
However, can I set a variable just for the bob-job
line?
I know I can do:
FOO=bar
1 0 bob-job /home/bob/script.sh
FOO=
... but this is not equivalent because it clobbers the existing value of FOO, if any (from the parent environment of anacron), and setting FOO=
to empty is not also equivalent to unset.
FOO
being used anywhere else in the script? If not, then why do you need to unset it? If you need to do it for some other reason, then useunset FOO
. – Nasir Riley Apr 08 '20 at 02:28