0

I am trying to create an upstart configuration file where inside the script section I am using shopt command to set the nullglob paramater -

shopt -s nullglob

However, with this I am getting the following error -

/proc/self/fd/9: 8: /proc/self/fd/9: shopt: not found

Can we use shopt inside an upstart script, has anyone used this before? Also, since shopt is a builtin command I couldn't find the exact path that I can include in my script to execute shopt from there. Any pointers would be extremely appreciated.

FYI - I am working on Ubuntu.

I am able to use shopt from command line and from a shell script. However only while using it inside the upstart configuration file I am having this issue.

Thanks!

7

1 Answer 1

0

Thanks for the comments it helped me troubleshoot the actual issue. As steeldriver mentioned shopt is a bash builtin and sinceupstart uses /bin/sh by default and it is symlinked to dash, therefore shopt wasn't working.

Also the script in which shopt worked was a bash script (hope it answers bodho.zazen's question).

After some research what I did was enclose my shopt command like this in the script section, and this worked -

script 

/bin/bash <<'EOF'
  <my-code>
  shopt -s nullglob
  <my-code>
EOF

end script

Thanks to all of you for helping me out! :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .