Are there any differences between commands that you type into the terminal and commands you include in a script?
|
Your terminal runs a shell (most probably Besides of this interactive mode you can also use your shell to run commands from a file. To execute the commands in your file you can either call the shell directly like Most probably both your interactive shell and the shell used to run is One important thing to note is that the script is run as a new process. This especially means that variables set in the script are not visible in the calling shell.
Without the export | ||||
|
In general, the answer would be "no", commands in shell are the same in scripts, in syntax and semantics. But there is a bunch of small nuances related to configuration of environment (what variables are used and to what they are set).
| |||
|
no. a script is a list of command you can type in the terminal. you can paste the totality of a script in the terminal and the result will be the same as running it. inversely you can "save" your terminal commands inside of a file and turn it into a reusable script and share it with your family and friends. | |||||||||||||||||
|