#!/bin/csh -x
exec bash
source ~arovit/RTM_test/unit_RTM/fail.10/failure.001.sh
exec csh
<script continues...>
is there any other way to do so ?
If the whole purpose of the bash script is to export the relevant env variables, I'd suggest you run the script as bash, the call the following script using csh. E.g.:
#!/bin/bash
source ~arovit/RTM_test/unit_RTM/fail.10/failure.001.sh
csh -x your_csh_script.sh
If the bash script isn't exporting vars, and is simply performing some tasks, then do it the other way round:
#!/bin/csh -x
bash ~arovit/RTM_test/unit_RTM/fail.10/failure.001.sh
<script continues...>
exec bash will start up an instance of bash and passing on control to it. The remainder of the script is run as usual (using csh) only when that instance ends.
execreplaces the script with a (probably interactive) bash.