i want to write a shell script that can be able to change the shell, i.e. i wrote a code that can run correctly in bash and not in csh, so, i want to add something in the code so that it automatic can change the shell to bash, whatever the current shell is, and after finishing , it automatically reload the previous shell....
Hi
You can specify the interpreter (and options) for the script at the beginning of the script as "#<path to the interpreter>".
Eg: #!/bin/bash
#!/bin/sh
#!/usr/bin/perl
When your shell script exits, no matter which language or interpreter you use, the previous environment is restored. Which means you're are already automatically back to your original shell.