1

The code:

`cat <(fgrep -i -v "$DAEMON_TEST" <(sudo -u asm crontab -l)) <(echo "$CRON") | sudo -u asm crontab -`

The error:

command substitution: line 46: syntax error near unexpected token `('
/etc/init.d/asm: command substitution: line 46: `cat <(fgrep -i -v "$DAEMON_TEST" <(sudo -u asm crontab -l)) <(echo "$CRON") | sudo -u asm crontab -'

The command runs fine when run directly into the shell by replacing the variables with the relevant strings

Here are the variables:

DAEMON_TEST=asm_test.php
CRON="*/15 * * * * /opt/asm/daemons/test.php"
Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
HyderA
  • 20,651
  • 42
  • 112
  • 180

1 Answers1

1

The issue ended up being completely unrelated.

Changed:

#/bin/sh

to:

#/bin/bash

I never realized there would be a differnce

https://superuser.com/questions/125728/what-is-the-difference-between-bash-and-sh

Community
  • 1
  • 1
HyderA
  • 20,651
  • 42
  • 112
  • 180