Question

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"
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top