I want to execute multiple commands after a sudo command

su - appuser -c "cd /apps/bundle/bundle-client/bin ; export BDL_WEB_USER=not_used ; export BDL_WEB_PASSWORD=not_used ; ./bundle -b ${option.BundleName} ${option.Ports}"

It seems to throw an error


bash: cd /apps/bundle/bundle-client/bin ; export BDL_WEB_USER=not_used ; export BDL_WEB_PASSWORD=not_used ; ./bundle -b ${option.BundleName} ${option.Ports}: bad substitution

Have you faced issues while using multiple commands after sudo?

  • i have never faced such issues ... BTDT for my tunnel setups via sudo
    – Skaperen
    Mar 24, 2015 at 12:59
  • Which one is it, sudo or su? What command did you expect to run — ${option.BundleName} isn't valid shell syntax even without the su part. Mar 24, 2015 at 23:23

1 Answer 1


use single quotes since double quotes is doing $ stuff in the first shell

  • That may or may not be it — bash -c 'echo ${option.Bundle}' isn't valid syntax either. Or is appuser a user whose shell isn't Bourne-like? Mar 24, 2015 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.