Denis Heidtmann wrote:
> [many omissions for bevity]

> Your explanation does indeed help me understand what gdmwhich() does.
> Since my script resides in one of my directories not in the $PATH, I chose
> to execute it above the setting of IFS to : using its fully qualified path.
>  It executes fine, and does what is intended.  However, if I source my
> script rather than execute it, the argument does not get passed.  I am
> assuming now that this behavior is normal for dash.  My remedies are 1) to
> execute my script in PostSession/default, in which case the argument is
> passed as expected, or 2) source a special script which has the argument
> hard-coded in it.
>
> To decide which remedy to choose I would like to know why the Debian Policy
> states that scripts used should be sourced.  If violating that policy would
> cause no problem that would be my choice.  That is what I have set up at
> present, and I have noticed no problems.  However, lacking the understanding
> of the motivation for the Policy, I cannot be certain that a problem will
> not arise.
>
> So, in summary, my original question was: Why does the argument not get
> passed with a sourced invocation? (answer: normal behavior of dash).  The
> question now is: If I execute a script from PostSession/default will I cause
> a problem?
>
> Thanks so much for the effort you  have put in toward my education.
>
> -Denis
>   
Denis Heidtmann
While the most straight forward way could be to simply hard code the 
full_path_name_to_your_executable into the appropriate Default 
executable, that would create a maintenance problem with Default, and 
could cause unexpected behavior should your_executable not be found 
there, or fail for some reason (i.e., one would have to add all of the 
appropriate exception handling routines to Default, and then do it all 
over again, including the appropriate testing, every time there was an 
upgrade.

But to add a line or two to Default to (a) get the full path name, and 
then (b) execute your_executable, changes the complexion ... for one 
thing, gdmwhich has a bit of error handling in  that it returns nothing 
(empty string) if it cannot find your_executable, and nothing on a line 
by itself (within a program, in this case Default) doesn't do anything, 
so there isn't a problem.  OK?

Now, suppose we thought ... oh, but there may be some unknown number of 
new executables that might be called within Default (at some time in the 
future?)  Well then we might want to make a text file to contain the 
list of those new executables, and add a routine to Default to browse 
through that list, finding the executables, complete their paths, and 
call them each sequentially.

That much said, perhaps we should turn our attention to "if I source my 
script rather than execute it, the argument does not get passed."  Could 
you please, state what is happening here?  For example:  From withing 
Default you are calling script_1, is that correct?

If that is correct, are you attempting to pass an argument to script_1?

And then, what does script_1 do?  For example:  Does it try to return 
some value to Default?

Any clarification would be most welcome
Regards
Fred James

_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to