daily cron job fails due to bash-ism

Bug #1984791 reported by cleary
This bug report is a duplicate of:  Bug #2004007: cronjob fails in dash. Edit Remove
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OCS Inventory: Agent Deployment Tool
New
Undecided
Unassigned

Bug Description

Ubuntu 22.04 LTS "jammy"

The cron.daily script fails to run:

$ sudo /etc/cron.daily/ocsinventory-agent
+ PROG=/usr/bin/ocsinventory-agent
+ [ ! -x /usr/bin/ocsinventory-agent ]
/etc/cron.daily/ocsinventory-agent: 20: arithmetic expression: expecting primary: " /100 "

The arithmetic expression in question is:

sleep $(( $RANDOM/100 ))

--
Which works fine in bash, but does not work in /bin/sh (pointing to dash by default)

The shebang in the daily cron script is:

#!/bin/sh

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.