Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

General programming discussion • Re: [SOLVED]bash programming compare operation acting differently in crontab

$
0
0
Stepping back a bit, there are 2 points to be made here:

1) This is a "dash" vs. "bash" thing. bash takes either = or ==, while dash only likes =.

More precisely, it's a bash vs whatever cron defaults to issue. Which, last time I checked, on RPiOS was /bin/sh.* Though it's not specific to cron.

If you need your script to use a specific shell you need to include a shebang with that shell in it.

@OP:
[shameless sekf promotion]
If you need to know more about cron see viewtopic.php?t=347524
[/shameless sekf promotion]

*: which is a symlink to /bin/dash. I've no idea if dash behaves differently when called as dash or as sh. Some things do.

Statistics: Posted by thagrol — Fri Nov 22, 2024 11:46 am



Viewing all articles
Browse latest Browse all 4906

Trending Articles