From owner-freebsd-questions Thu Mar 14 20:43:20 2002 Delivered-To: freebsd-questions@freebsd.org Received: from nycsmtp2out.rdc-nyc.rr.com (nycsmtp2out.rdc-nyc.rr.com [24.29.99.227]) by hub.freebsd.org (Postfix) with ESMTP id 838FF37B404 for ; Thu, 14 Mar 2002 20:43:17 -0800 (PST) Received: from scott1.nyc.rr.com (24-168-24-239.nyc.rr.com [24.168.24.239]) by nycsmtp2out.rdc-nyc.rr.com (8.12.1/Road Runner SMTP Server 1.0) with ESMTP id g2F4fOlu011787; Thu, 14 Mar 2002 23:41:24 -0500 (EST) Message-Id: <5.1.0.14.0.20020314233515.00c24b58@pop-server.nyc.rr.com> X-Sender: scottro@pop-server.nyc.rr.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 14 Mar 2002 23:43:14 -0500 To: "Jeff Jeter" , "FreeBSD Questions" From: Scott Subject: Re: Shell Scripts In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 23:19 2002/03/14 -0500, Jeff Jeter wrote: >How do i make a shell script run if i just type in the file name if i am in >the dir or if it's in my path? If it's in your path, then simply typing the script name will make it run. Say you have a script called scriptx. If it's in any of the directories in your path (which you can find out by typing echo $PATH it will run anytime you type, at a command prompt scriptx If however, it's not in your path--for example, you have a directory called test, that's not in your path. You put scriptx in directory test. Now, if you're in directory test and you want to run scriptx you simply type ./scriptx (Before doing this, you have to make the script executable by doing a chmod--for example, if you want all users to be able to use the script chmod 755 scriptx) The other way to do it (and you don't even have to do a chmod for this to work) is to type sh scriptx. Or, if you're in your home directory, and scriptx is in the test directory which is in your home directory sh test/scriptx HTH. Not sure how much you know about all this, so if I gave you too much information, I apologize. Scott Robbins >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message