Is there an equivalent source command in Windows CMD as in bash or tcsh?
In the usual Windows command prompt (i.e. cmd.exe), just using call mybat.bat did what I wanted. I got all the environment variables it had set.
In the usual Windows command prompt (i.e. cmd.exe), just using call mybat.bat did what I wanted. I got all the environment variables it had set.
Try linux command chsh. The detailed command is chsh -s /bin/bash. It will prompt you to enter your password. Your default login shell is /bin/bash now. You must log out and log back in to see this change. The following is quoted from man page: The chsh command changes the user login shell. This determines … Read more
Take a look at the various test operators (this is for the test command itself, but the built-in BASH and TCSH tests are more or less the same). You’ll notice that -x FILE says FILE exists and execute (or search) permission is granted. BASH, Bourne, Ksh, Zsh Script if [[ -x “$file” ]] then echo … Read more
There are three approaches to finding the name of the current shell’s executable: Please note that all three approaches can be fooled if the executable of the shell is /bin/sh, but it’s really a renamed bash, for example (which frequently happens). Thus your second question of whether ps output will do is answered with “not … Read more
This depends on what shell you are using. If you are using bash, then the ulimit command controls several settings relating to program execution, such as whether you should dump core. If you type ulimit -c unlimited then that will tell bash that its programs can dump cores of any size. You can specify a … Read more
Use the “dot space script” calling syntax. For example, here’s how to do it using the full path to a script: . /path/to/set_env_vars.sh And here’s how to do it if you’re in the same directory as the script: . set_env_vars.sh These execute the script under the current shell instead of loading another one (which is … Read more