Penguin

Differences between version 55 and previous revision of BashNotes.

Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History

Newer page: version 55 Last edited on Saturday, April 21, 2007 8:43:06 am by BenStaz Revert
Older page: version 54 Last edited on Wednesday, April 18, 2007 11:20:35 am by BenStaz Revert
@@ -407,12 +407,25 @@
  
 *vim -- --test 
  
 The '--' tells the command that what follows is an argument, NOT to interpret them as options. 
+  
+!How to directly interpret a shell script by the current shell. (Without forking a subshell)  
+  
+*. <myscript>  
+  
+If the above script makes a change to the environment, it is the environment of this shell that is changed.  
+So if inside the script we change the directory, then when the script has finished being interpreted we will find ourselves in the new directory.  
+  
+Note : This can be handy when you want to reset the shell environment variables.  
+  
+Just do:  
+  
+*. ~~/.bashrc  
  
 !! See also 
  
 * CommonErrors, under "Your shell hangs" 
 * BashOneLiners 
 * SpacesInPathNames 
 * PortabilityNotes 
 * [bash reference manual|http://www.gnu.org/software/bash/manual/bashref.html]