home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!know!mips2!news.bbn.com!usc!sdd.hp.com!swrinde!gatech!hubcap!opusc!usceast!douglas
- From: douglas@cs.scarolina.edu (David Douglas)
- Newsgroups: comp.graphics.gnuplot
- Subject: Re: Comment on GnuPlot V3.2 (under Unix)
- Message-ID: <douglas.721590281@peach.cs.scarolina.edu>
- Date: 12 Nov 92 17:44:41 GMT
- References: <921105105653.1747@CUCCFA.CCC.COLUMBIA.EDU> <1992Nov5.194056@helix.nih.gov>
- Sender: usenet@usceast.cs.scarolina.edu (USENET News System)
- Organization: USC Department of Computer Science
- Lines: 73
-
- rvenable@helix.nih.gov (Richard M. Venable) writes:
-
- >In article <921105105653.1747@CUCCFA.CCC.COLUMBIA.EDU>,
- >MARK@CUCCFA.CCC.COLUMBIA.EDU (T. Mark Reboul) writes:
- >|> I have however noted just one minor thing which seems to me like a
- >|> deficiency.... I don't know how easy this would be to change, but it
- >|> would be useful if the user could enter a "cd" command of the form:
- >|>
- >|> cd "~username/whatever"
- >|>
- >|> The tilde spec doesn't seem to be allowed. (Am I doing something
- >wrong?)
-
- >The tilde is a construct of the C shell (/bin/csh), and is not
- >recognized
- >by system calls requiring a pathname. In some of our programs here at
- >NIH
- >we substitute the value of the env var HOME for the tilde, which would
- >permit cd "~/whatever" but not the above syntax.
-
- >|> I also noticed that even this command:
- >|>
- >|> ! cd ~username
- >|>
- >|> doesn't work, as the "system" function call generated by my command
- >|> won't handle the tilde.
-
- >The above should work if /bin/csh is your login shell; however, the !
- >operation spawns a new subshell, so that even if you do change
- >directories,
- >as soon as the subshell exits, you're back in the directory you were in
- >before.
-
-
- ><---------------------------------------------------------------------->
- >>
- >< Rick Venable (O O) | "Back off, I'm a scientist."
- >>
- >< FDA/CBER Biophysics Lab )|( | -- Bill Murray in
- >>
- >< rvenable@helix.nih.gov (=) | 'Ghostbusters'
- >>
- ><---------------------------------------------------------------------->
- >>
-
- One note I'd like to make here (I think I said it before, but anyway...)
- The system command, at least from what I see in the manual page on it
- here, ONLY accesses the /bin/sh shell, not /bin/csh. From the man page
- here for the system command:
-
- If the string argument is the NULL pointer (0) the system function tests
- the accessibility of the command interpreter sh(1). The function will
- return zero for failure to find the command interpreter, and positive if
- successful.
-
- If the string argument is non-NULL the system routine causes the string
- to be given to sh(1) as input as if the string had been typed as a com-
- mand at a terminal. The current process waits until the shell has com-
- pleted, then returns the exit status in the form that wait(2) returns.
-
-
- So, in otherwords, if you want to use a shell with the "!" command,
- and use the "~" to access a particular user's directory, try something
- like the following:
-
- ! csh -c 'cd ~username/directoryname ; next command ; next command ; (etc.)'
-
- where all your shell commands (separated by semicolons) are enclosed in the
- ''s immediately following the -c option given to csh.
-
- Hope this helps!
-
- David Douglas
-