0

I keep getting the following error when running the following command: bash - syntax error near unexpected token (.

A=/dev1/annemarie/
B=/home/annemarie/
diff -u <(find "$B" |sed "s:$B::") <(find "$A" | sed "s:$A::") | sed "/^+\//!d; s::$A/:"

or

diff -u <(find " B=/home/annemarie/" |sed "s: B=/home/annemarie/::") <(find "/dev1/annemarie/" | sed "s:/dev1/annemarie/::") | sed "/^+\//!d; s::/dev1/annemarie//:"

or

echo "diff -u <(find \"$B\" |sed \"s:$B::\") <(find \"$A\" | sed \"s:$A::\") | sed \"/^+\//!d; s::$A/:\" >> /tmp/$$.sh

Where is the problem?

methuselah
  • 12,766
  • 47
  • 165
  • 315

1 Answers1

2

Scripts with process substitution must be run via bash, not sh. Ensure that the shebang references /bin/bash and/or that the script is being passed to bash on the command line.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358