home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / graphics / gnuplot / 362 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  3.2 KB

  1. Path: sparky!uunet!know!mips2!news.bbn.com!usc!sdd.hp.com!swrinde!gatech!hubcap!opusc!usceast!douglas
  2. From: douglas@cs.scarolina.edu (David Douglas)
  3. Newsgroups: comp.graphics.gnuplot
  4. Subject: Re: Comment on GnuPlot V3.2 (under Unix)
  5. Message-ID: <douglas.721590281@peach.cs.scarolina.edu>
  6. Date: 12 Nov 92 17:44:41 GMT
  7. References: <921105105653.1747@CUCCFA.CCC.COLUMBIA.EDU> <1992Nov5.194056@helix.nih.gov>
  8. Sender: usenet@usceast.cs.scarolina.edu (USENET News System)
  9. Organization: USC  Department of Computer Science
  10. Lines: 73
  11.  
  12. rvenable@helix.nih.gov (Richard M. Venable) writes:
  13.  
  14. >In article <921105105653.1747@CUCCFA.CCC.COLUMBIA.EDU>,
  15. >MARK@CUCCFA.CCC.COLUMBIA.EDU (T. Mark Reboul) writes:
  16. >|> I have however noted just one minor thing which seems to me like a 
  17. >|> deficiency.... I don't know how easy this would be to change, but it
  18. >|> would be useful if the user could enter a "cd" command of the form:
  19. >|> 
  20. >|>     cd  "~username/whatever"
  21. >|> 
  22. >|> The tilde spec doesn't seem to be allowed. (Am I doing something
  23. >wrong?)
  24.  
  25. >The tilde is a construct of the C shell (/bin/csh), and is not
  26. >recognized
  27. >by system calls requiring a pathname.  In some of our programs here at
  28. >NIH
  29. >we substitute the value of the env var HOME for the tilde, which would
  30. >permit   cd "~/whatever"  but not the above syntax.
  31.  
  32. >|> I also noticed that even this command:
  33. >|> 
  34. >|>     !  cd  ~username
  35. >|> 
  36. >|> doesn't work, as the "system" function call generated by my command 
  37. >|> won't handle the tilde.
  38.  
  39. >The above should work if /bin/csh is your login shell; however, the !
  40. >operation spawns a new subshell, so that even if you do change
  41. >directories,
  42. >as soon as the subshell exits, you're back in the directory you were in
  43. >before.
  44.  
  45.  
  46. ><---------------------------------------------------------------------->
  47. >>
  48. ><  Rick Venable                (O O) |  "Back off, I'm a scientist."  
  49. >>
  50. ><  FDA/CBER Biophysics Lab      )|(  |        -- Bill Murray in       
  51. >>
  52. ><  rvenable@helix.nih.gov       (=)  |           'Ghostbusters'       
  53. >>
  54. ><---------------------------------------------------------------------->
  55. >>
  56.  
  57. One note I'd like to make here (I think I said it before, but anyway...)
  58. The  system  command, at least from what I see in the manual page on it
  59. here, ONLY accesses the /bin/sh shell, not /bin/csh.  From the man page
  60. here for the  system  command:
  61.  
  62.   If the string argument is the NULL pointer (0) the system function tests
  63.   the accessibility of the command interpreter sh(1).  The function will
  64.   return zero for failure to find the command interpreter, and positive if
  65.   successful.
  66.  
  67.   If the string argument is non-NULL the system routine causes the string
  68.   to be given to sh(1) as input as if the string had been typed as a com-
  69.   mand at a terminal.  The current process waits until the shell has com-
  70.   pleted, then returns the exit status in the form that wait(2) returns.
  71.  
  72.  
  73. So, in otherwords, if you want to use a shell with the "!" command,
  74. and use the "~" to access a particular user's directory, try something
  75. like the following:
  76.  
  77. ! csh -c 'cd ~username/directoryname ; next command ; next command ; (etc.)'
  78.  
  79. where all your shell commands (separated by semicolons) are enclosed in the
  80. ''s immediately following the  -c  option given to csh.
  81.  
  82. Hope this helps!
  83.  
  84. David Douglas
  85.