HP3000-L Archives

March 2000, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Fri, 24 Mar 2000 14:46:08 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (25 lines)
Carl McNamee wrote:
> I am curious about something that I have been running into in the posix
> shell.  Why do I have to qualify the name of a script to be run with "./"?
> If I have the script "test" in the directory "/SYS/CARL/" and I am in the
> CARL directory I have to run the test script by typing "./test".  Why can't
> I just type "test" and have it run?

Check your PATH environment variable:

        echo $PATH

If you want your script to run when you enter its unqualified name, your PATH
needs to contain either an entry for /SYS/CARL, or the current working
directory indicated by a single period (.) character.

Some people consider . in PATH to be a security risk because when you cd into a
new directory, and then try to run an unqualified command name, you may find
yourself surprised if that directory contains that command where somebody
implemented different functionality.

- Mark B.

PS: "test" is a bad choice for a file name because it conflicts with a shell
command called "test".

ATOM RSS1 RSS2