Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: $cd /bin



 On Nov 21, 2007 1:08 PM, Ben Eisenbraun <[hidden email]> wrote: 
> Why didn't the directory change? 

Well, that example is not particularly useful, right?  It merely shows 
that a sub-shell process ran and exited, all without changing the 
current directory.  The original shell process, of course, maintained 
its current directory as it would with the execution of any 
subprocess.  It would really suck if the root user's current directory 
kept changing while he ran a script in the background :-) 

khermans@hermbuntu-desktop:/tmp$ cat foo.pl 
#!/usr/bin/perl 
print "Current dir is..." . `pwd`; 
print "Changing dirs...\n"; 
print "New dir is..." . `cd /etc/; pwd`; 
khermans@hermbuntu-desktop:/tmp$ perl foo.pl 
Current dir is.../tmp 
Changing dirs... 
New dir is.../etc 
khermans@hermbuntu-desktop:/tmp$ pwd 
/tmp 
-- 
Kristian Erik Hermansen 

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner, and is 
believed to be clean. 

_______________________________________________ 
Discuss mailing list 
[hidden email] 
http://lists.blu.org/mailman/listinfo/discuss
 


BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org