Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Mar 1998 23:38:27 -0800
From:      Studded <Studded@dal.net>
To:        tim@v-com.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: perl scripts to commands?
Message-ID:  <34FE5673.76409938@dal.net>
References:  <2.2.32.19980305062210.006e45ec@v-com.com>

next in thread | previous in thread | raw e-mail | index | archive | help
tim@v-com.com wrote:

> as the fist line I put "#!/usr/bin/perl"
> 
> Although I installed perl to a different directory, I copied the the "perl"
> binary to the standard directory as the first line expects.

	I assume from your question that you're a new user. (Don't worry, we
were all new once. :) You might consider using a symlink in /usr/bin
instead of copying the binary. This saves you a tiny bit of disk space
(which may or may not be a factor) but more importantly the more you get
used to symlinks the more trouble you can save yourself. :)  Do man ln
in a shell to get more info if you need it. 
 
> I "chmod +x" to get it to be able to execute.
> 
> And of course when I try to execute it, I get "Command not found"
> 
> Somebody responded to one of the other e-mail questions I browsed and said
> to try "./" before the perl script command.
> 
> It works, but why do I have to do it?

	In Unix (unlike DOS) the binaries in the directory you are currently in
may or may not be in your path, depending on certain factors. This is
done mostly for security so that some malicious person can't drop
something into your directory like 'ls' which is actually a script which
erases your home directory (or something worse). 

	For now, you should develop the habit of typing ./binaryname for things
you want to execute in the directory you're in. By the time you don't
need to do that anymore, you'll have figured out how to avoid it on your
own. :)

	I also highly recommend visiting http://www.freebsd.org/ and have a
look around. There is an excellent tutorial for new users in the
documentation section.

Good luck,

Doug

-- 
***         Chief Operations Officer, DALnet IRC network       ***
*** Proud operator, designer and maintainer of the world's largest
*** Internet Relay Chat server.  5,328 clients and still growing.
*** Try spider.dal.net on ports 6662-4    (Powered by FreeBSD)

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?34FE5673.76409938>