Authorization error running db2 command line with db2inst1
update dbm cfg is run by your user in the sh, not the user you connected as. You can attach to the instance as a particular user:
db2 attach to instance db2inst1 user db2inst1 

or:
db2 attach to instance db2inst1 user db2inst1 using &lt;password&gt;

and then:
db2 update dbm cfg using INTRA_PARALLEL YES

Documentation can be founds at ATTACH
In addition to that, I find it much easier to run db2 directly from the sh (as I did above) instead of starting db2 clp separately. You can use the sh as a host language and for example do loops over a resultset:
#&gt; db2 connect to mydb
#&gt; for t in $(db2 -x &quot;select ...&quot;); do
       echo &quot;The table is ${t}&quot;
   done  

Of course just a silly example, but it is a powerful mechanism for running db2 from a sh script