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:newbie_traps [2019/08/30 09:18]
ersen [Exporting]
scripting:newbie_traps [2020/05/28 12:34] (current)
fgrose [Exporting] clarify English
Line 155: Line 155:
 ==== Exporting ==== ==== Exporting ====
  
-Exporting a variable means to give **newly created** (child-)processes a copy of that variable. **not** copy a variable created in a child process to the parent process. The following example does **not** work, since the variable ''​hello''​ is set in a child process (the process you execute to start that script ''​./​script.sh''​):​+Exporting a variable means giving ​**newly created** (child-)processes a copy of that variable. ​ It does **not** copy a variable created in a child process ​back to the parent process. The following example does **not** work, since the variable ''​hello''​ is set in a child process (the process you execute to start that script ''​./​script.sh''​):​
  
 <​code>​ <​code>​
Line 186: Line 186:
 grep ^root: /etc/passwd >/​dev/​null 2>&1 grep ^root: /etc/passwd >/​dev/​null 2>&1
  
-if [ $? -neq 0 ]; then+if [ $? -ne 0 ]; then
   echo "root was not found - check the pub at the corner"​   echo "root was not found - check the pub at the corner"​
 fi fi
  • scripting/newbie_traps.1567156690.txt
  • Last modified: 2019/08/30 09:18
  • by ersen