Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
scripting:processtree [2015/08/06 05:08]
bill_thomson
scripting:processtree [2017/06/13 08:16] (current)
mtmr type from importss -> imports
Line 9: Line 9:
 Every process has its **own** environment space. Every process has its **own** environment space.
  
-The environment stores, among other things ​other stuff, data that's useful to us, The **environment variables**. These are strings in common ''​NAME=VALUE''​ form, but they are not related to shell variables. A variable named ''​LANG'',​ for example, is used by every program that looks it up in its environment to determinate the current locale.+The environment stores, among other things, data that's useful to us, The **environment variables**. These are strings in common ''​NAME=VALUE''​ form, but they are not related to shell variables. A variable named ''​LANG'',​ for example, is used by every program that looks it up in its environment to determinate the current locale.
  
 **__Attention:​__** A variable that is set, like with ''​MYVAR=Hello'',​ is **not** automatically part of the environment. You need to put it into the environment with the bash builtin command ''​export'':​ **__Attention:​__** A variable that is set, like with ''​MYVAR=Hello'',​ is **not** automatically part of the environment. You need to put it into the environment with the bash builtin command ''​export'':​
Line 45: Line 45:
 ===== Bash playing with pipes ===== ===== Bash playing with pipes =====
  
-Pipes are a very powerful tool. You can connect the output of one process to the input of another process. We won't delve into pipin at this point, we just want to see how it looks in the process tree. Again, we execute some commands, this time, we'll run ''​ls''​ and ''​grep'':​+Pipes are a very powerful tool. You can connect the output of one process to the input of another process. We won't delve into pipign ​at this point, we just want to see how it looks in the process tree. Again, we execute some commands, this time, we'll run ''​ls''​ and ''​grep'':​
  
 <​code>​ <​code>​
Line 103: Line 103:
 But if your command is a subprocess that sets variables you want to use in your main script, that won't work. But if your command is a subprocess that sets variables you want to use in your main script, that won't work.
  
-For exactly this purpose, there'​s the ''​source''​ command (also: the //dot// ''​.''​ command). Source doesn'​t execute the script, it importss ​the other script'​s code into the current shell:+For exactly this purpose, there'​s the ''​source''​ command (also: the //dot// ''​.''​ command). Source doesn'​t execute the script, it imports ​the other script'​s code into the current shell:
 <​code>​ <​code>​
 source ./​myvariables.sh source ./​myvariables.sh