use the "-c" switch of su to execute commands. Even then i suppose that using sudo, su AND a here-document in one line might be too much for the shell to parse.
Try it the following way:
sudo su - <user> -c <script>
Where <script> contains the here-document. If nothing else this will at least make it easier to find out where the problem really is.
if we want run script with sudo su - <user> -c <script>[/code] this scname should added into sudo configration files(i am not sure file name).
$ sudo su - micdev1b -c /m61/micdev1b/work/dm/scripts/run_dms70_10_atai_dbanalyze.sh
Sorry, user rsiddaba is not allowed to execute '/usr/bin/su - micdev1b -c /m61/micdev1b/work/dm/scripts/run_dms70_10_atai_dbanalyze.sh' as root on ducati.