Re: despair



In article <1190309266.107100.248910@xxxxxxxxxxxxxxxxxxxxxxxxxxx>, AEF <spamsink2001@xxxxxxxxx> writes:
On Sep 20, 12:24 pm, "Tom Linden" <t...@xxxxxxxxxxxxxx> wrote:
On Thu, 20 Sep 2007 09:04:34 -0700, AEF <spamsink2...@xxxxxxxxx> wrote:
Tell that to Paul Raulerson. It wasn't my idea. I was demonstrating
how his suggested equivalent doesn't work. Why the "./"? I know it
runs things a little differently than without it, but I forget exactly
how.

That has to do with the PATH environment variable which tells the shell
the order of search. ./ just means current directory

--
PL/I for OpenVMSwww.kednos.com

There must be something more to it.

No. There isn't anything more to it.

Aren't you already in the current
directory?

Yes. You are. But that doesn't mean that a token that you type
at the beginning of a command line is treated as a request to
look for like-named file in the current directory and execute it, if
found.

It is treated as a request to look for a like-named file in your $PATH
and execute it, if found.

Your current directory may or may not be in your $PATH. One common
anti-trojan measure is to ensure that the current directory is
not in your $PATH.

Just as on VMS, the current default directory is used as a default
directory in which files specified with unqualified file names are
found or created and as a starting point for locating files specified
with relative directory names.

(On Unix, relative names are names such as foo/bar.dat or ../../foo/bar.dat
and on VMS relative names are names such as [.foo]bar.dat or [--.foo]bar.dat)

Is there some way to be somewhere else? You could use SYS
$DISK:[] as the same in VMS (as long as you're not a directory such as
SYS$STARTUP) to mean "current directory", but few people bother to
type it in!

Compare to DCL$PATH. If SYS$DISK:[] is not in DCL$PATH then
the existence of FOO.EXE in your default directory will not
make "$ FOO BAR" a meaningful DCL command.

Same way, if ./ is not in $PATH then the existence of foo
in your default directory will not make "csh> foo bar" a meaningful
C shell command.

(Though typing [] for current directory can in the case of
being in SYS$STARTUP be used to refer to the "current directory"
instead! But I don't see how that would apply in Unix.)

AEF

.



Relevant Pages

  • Re: despair
    ... I once tried to write a cd program in Unix. ... Just putting a cd command in a script and then ... hell are you supposed to write shell script macros to run a frequently ... make "$ FOO BAR" a meaningful DCL command. ...
    (comp.os.vms)
  • Re: How does Sendmail know how it was invoked?
    ... appropriate command in mailer.conf. ... All of the entries in mailer.conf ... int main (int argc, char* argv) ... $ mv foo bar ...
    (freebsd-questions)
  • Re: FTP delete
    ... Actually in the IBM manual for ftp commands, ... "(replace" for the GET, MGET, and REPLACE commands, not the PUT command. ... put foo bar ... For IBM-MAIN subscribe / signoff / archive access instructions, ...
    (bit.listserv.ibm-main)
  • Re: cp vs. cpio
    ... > cp will definitely not maintain the hard link relationships. ... > ln foo bar ... But since you didn't specify that option in your command, ... the -l option tells cpio to try to link the new files to the original ...
    (comp.unix.questions)
  • Re: Running Standalone Lisp Programs
    ... The existence and structure of command line arguments is not a portable ... Rahul Jain ... Professional Software Developer, Amateur Quantum Mechanicist ...
    (comp.lang.lisp)