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

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



Hello, Linuxers,

Bob Nolte wrote:

 > <snip>
 > 
 > 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.
 > 
 > 2.  When I try to use exit in an if statement, it exits completely
 >     and logs me out.
 > 
 > <snip>

The two problems may be related; if the script were executing in its
own shell, the exit would just exit the subshell.  As it is, the use of
the '.' expression causes the script to be evaluated in the current
shell (as Len pointed out), so the exit command does log you out.  So,
problem number two will go away when you stop working around problem
number one the way you are.

I assume that the other posts about the path settings will yield the
desired results; I did want to make a clarification about setting file
modes, however, since this is a security issue about which people
should not be misinformed.  Brian mentioned these mode settings, but
the arguments he described should not do what he said they would.  When
a command like

  chmod <who><op><perm> <file>

is executed, the permission <perm> is modified for <file> using
operation <op> for the user class <who>.  The <who> is either [u]ser
(the user ID associated with the file), [g]roup (the group ID
associated with the file), [o]ther (_all_ users, regardless of ID), or
[a]ll three user classes.  Access to the file thus increases as
successive user classes are added in the order given:  u, g, and o.  I
have gotten u and o mixed up many times, thinking they stood for
[u]sers and [o]wner, which they don't!!!  Hope that clears things up.
Obviously, man chmod will give the definitive answer for the system you
are using.

That's all,

  Jonathan

-- 
 /       Jonathan R. Johnson       | "Every word of God is flawless." \
 |    Minnetonka Software, Inc.    |                 -- Proverbs 30:5 |
 \ johnsonj@MinnetonkaSoftware.com |  My own words only speak for me. /