Bash function to set NSW and ISIF (in principle any program)