TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:751] Problem running scripts - Need Advice



On Wed, Jul 29, 1998 at 06:23:46AM -0500, Bob Nolte wrote:
> 
> 1.    I can't run any script without running in the current environment, ie.
>         .  scriptname. I get the error   bash: [script]: command not found
>         unless I do the dot thing.
> 

the problem you are having is a easy one to fix ... check out the first
line of your script, it should have something like

#!/bin/sh

this is the shell it will use to execute the script ... make sure that the
path is correct ... you may have #!/usr/local/bin/bash, when in actuallity
bash is located in #!/bin/bash ... the '.' will tell the current shell you
are running to evaluate the file you give it, thus it will run the script
fine, that is why it works when you put the dot in front of it ... try
doing that with your .zlogin (.profile, .login, etc), it will re-read your
login script, reiniting any changes you have made to it.


> 2.    When I try to use exit in an if statement, it exits completely and
> logs
>         me out.
> 

make sure the shell you are running on supports the 'exit' statement ... if
i remember right, some shells require different exiting statements for the
if statement.

just a few thoughts ...

len.

-- 

	-  -  --  --- -----[ whisper@bitstream.net ]----- --- -- -   -  

				"See my heart, I decorate it like a grave."

  - -  -- ----[ 83 C0 55 57 7D AF 81 A1  7B 14 49 0C A0 7F 45 E8 ]-- -  -    -