learning script

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Michael Havens
Date:  
Subject: learning script
My tutorial said that if I am going to add '.' it to my path to add it as the
last searched. The problem I am having is that I don't know how ti add it as
the last directory searced.


On Monday 19 January 2004 08:51 am, Daniel McAferty said:
~ I know a lot of people don't like to do this but I
~ add the "." to may path. Then I don't have to type ./ to
~ run a command located in my current directory.
~
~ path = $path:.
~
~ Dan
~
~ > -----Original Message-----
~ > From: 
~ > [mailto:plug-discuss-admin@lists.plug.phoenix.az.us]On Behalf Of Craig
~ > White
~ > Sent: Sunday, January 18, 2004 4:46 PM
~ > To: 
~ > Subject: Re: Re:learning script
~ >
~ >
~ > On Sun, 2004-01-18 at 16:40, Michael Havens wrote:
~ > > my password? Where would that be?
~ > >
~ > > On Sunday 18 January 2004 01:40 pm, Bryce C said:
~ > > ~ ./dw
~ > > ~ Also, check your $PATH to see if your pwd is in it.
~ > > ~ echo $PATH
~ > > ~
~ > > ~ On Sun, 2004-01-18 at 13:38, Michael Havens wrote:
~ > > ~ > I am teying my hand at writing a basic script.
~ > > ~ >
~ > > ~ >     :
~ > > ~ >     # @(#)dw -- <text> --
~ > > ~ >     #
~ > > ~ >     date
~ > > ~ >     who -u
~ > > ~ >
~ > > ~ > So I type it in and then chmod  760 and after I try to
~ > execute it, it
~ > >  tells ~ > me:
~ > > ~ >
~ > > ~ >     command not found
~ > > ~ >
~ > > ~ > but it works if I 'sh dw' or 'sh<dw' any idea what's wrong?
~ > The current
~ > >  path ~ > is ~ and that is where the script is and I think that
~ > directory is
~ > >  searched ~ > first so there is no need for $PATH to be accessed.
~ > ---
~ > no - pwd
~ > print working directory
~ >
~ > Obviously not included if you just
~ > echo $PATH
~ >
~ > if you are in a directory that isn't in $PATH (normal for a user), then
~ > to execute a file, you must reference it...
~ >
~ > ./dw
~ >
~ > sh dw causes the shell program /bin/sh (which is in $PATH) to execute
~ > the local file dw
~ >
~ > dw doesn't execute because it's not in $PATH
~ >
~ > easier just to ./dw
~ >
~ > Craig
~ >
~ > ---------------------------------------------------
~ > PLUG-discuss mailing list - 
~ > To subscribe, unsubscribe, or to change  you mail settings:
~ > http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
~
~ ---------------------------------------------------
~ PLUG-discuss mailing list - 
~ To subscribe, unsubscribe, or to change  you mail settings:
~ http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
~


--
<:-)~MIKE~(-:>






This message has been scanned for viruses by the VEI Internet
Automatic Email Spam and Virus Scanner, and is believed to be free of spam or viruses.
Please report spam to . If you would like 98.9 % spam blocked from your
E-mail then go to VEI Internet for details. Anti-spam/Anti-virus is FREE with every account.


http://www.vei.net/