"cproc=${proc//[^A-Za-z0-9_]/_}" would break (Bad Substitution errors) on my Debian Wheezy system. Changed the interpreter to bash and script began to run without issue.