Why the "sed -r" ? I don't see the need for this. This line works fine for me:

```sed -i 's@\${g.rudder_base}@/opt/rudder@g' rudder-agent.cron```