Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Mar 1998 11:30:25 +0200 (SAT)
From:      Reinier Bezuidenhout <rbezuide@oskar.nanoteq.co.za>
To:        tim@v-com.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: perl: scripts to commands...weird
Message-ID:  <199803050932.LAA09544@oskar.nanoteq.co.za>
In-Reply-To: <2.2.32.19980305075844.006cffc0@v-com.com> from "tim@v-com.com" at "Mar 4, 98 11:58:44 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> Doing some playing around on my own I discovered a few oddities in the
> process of getting my perl scripts to be command line executable.
> 
> 1. the usual "#!/path_to_my_perl_binary/perl" must be the first line...duh.
> 2. gotta "chmod +x myperlscript.pl", yup.
> 
> now here's the weird stuff...
> 
> 3. I have to move it into one of the bin directories that is in my shell
> path. (I'm using csh as default)
> 4. I have to launch another shell or log out and log back in to my current
> one for it all to take effect.
> 
> I tested it. If I move it out of the bin directory I can not execute it
> anymore. If I move it into different bin directory, still being one that I
> have in my profile path, it won't work. Not until I start another shell or
> log out/in.
> 
> I can understand some of this limitation as I'm telling my shell to only
> look in certain directories and those in a certain order as well, but what I
> don't understand is why I have to play this musical shell game to get it to go.
> 
> Can anybody enlighten?
> 

After you have moved the file to another bin directory (that is in your
path) , type "rehash" it wil then know that that executable is in your
path.  I'm sure someone else can give you the exact info, but it kind of
cashes the info and rehash rereads that info.

Reinier


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803050932.LAA09544>