In order to run a script that's written in bash (i.e. it's interpretter is #!/bin/bash
), in any other shell, use either sh
before script name, as:-
~$ sh scriptname
~$ bash scriptname
In your case, try:-
~$ su auser -c "sh a.sh; sh b.sh"
~$ su auser -c "bash a.sh; bash b.sh"
Simple use of ./ will certainlly give your error.