home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7529 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.3 KB  |  40 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!cs.uiuc.edu!schwager
  3. From: schwager@mike.cs.uiuc.edu (Mike Schwager)
  4. Subject: Details regarding the exec command
  5. Message-ID: <BzH641.L0J@cs.uiuc.edu>
  6. Sender: news@cs.uiuc.edu
  7. Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL
  8. Date: Fri, 18 Dec 1992 21:52:49 GMT
  9. Lines: 29
  10.  
  11.  
  12.  
  13. Everyone please open their Bibles to page 143... :-)
  14.  
  15. I'm trying to understand the "exec" call better.  I notice on the
  16. aforementioned page that if I do
  17.  
  18. $shell = '/bin/csh';
  19. exec $shell '-sh';
  20. die "barf\n";
  21.  
  22. Then the shell believes it is a login shell- ie, $0 must be "-".  However,
  23. if I do this:
  24.  
  25. exec '/bin/csh' '-sh';
  26.  
  27. it gives me an error, and if I do this:
  28.  
  29. exec $shell, '-sh';
  30.  
  31. it is not a login shell.  I don't understand The Book here, nor is it clear
  32. what a "multi-valued list" is.  What exactly is exec'ed in the first
  33. example?  Why does it work, whereas if I explicitly use the string
  34. '/bin/csh' it fails?  Please enlighten me.
  35. -Mike
  36. aka, Mike Schwager               |"I will never apologize for the United States
  37. INTERNET:schwager@cs.uiuc.edu    | of America, ever.  I don't care what the
  38. Bye, George!!!                   | facts are."  -George Bush
  39. University of Illinois, Dept. of Comp. Sci., for whom I do not speak
  40.