0

From a shell script I am executing this:

exec "su - $PRODUCT_USER -c 'CATALINA_PID=\"$CATALINA_PID\" \"$CATALINA_RUN_SCRIPT\" start'"

and I get as an error in the console

./runService.sh[10]: su - testUser -c 'CATALINA_PID="/home/tomcat.pid" "/home/subScript.sh" start':  not found.
muru
  • 69,900
  • 13
  • 192
  • 292
Mike B.
  • 1
  • 2
  • Did you mean to use `eval` instead of `exec`? You don't need to quote the whole command to be a single word with `exec`. Just do `exec su - ....` – muru Jan 30 '20 at 08:29
  • Thanks, it worked, however now I get the message that "The specified path name is too long." – Mike B. Jan 30 '20 at 08:36
  • I sense the House of Horror again. https://unix.stackexchange.com/a/564427/5132 And abuse of `su`. https://unix.stackexchange.com/a/353698/5132 https://unix.stackexchange.com/a/465353/5132 – JdeBP Jan 30 '20 at 09:10

0 Answers0