[PLUG] bash question

Fred James fredjame at fredjame.cnc.net
Fri Apr 2 21:01:59 UTC 2010


Denis Heidtmann wrote:
> On Fri, Apr 2, 2010 at 12:39 PM, Denis Heidtmann
> <denis.heidtmann at gmail.com>wrote:
>
>   
>> On Fri, Apr 2, 2010 at 11:55 AM, Joe Pruett <joey at q7.com> wrote:
>>
>>     
>>> bash 3.2 on my system doesn't show this problem.  are you sure the full
>>> path and relative path actually get to the same script?  could you be
>>> accidentally running two different scripts?  or maybe it is some odd
>>> bash bug, what version do you have?
>>>
>>>       
>> Since /etc/gdm/PostSession/Default is a .sh script, I must use that shell,
>> also known as dash.  Maybe bash will not show the problem.  I have version
>> 3.2.48(1)-release (x86_64-pc-linux-gnu).
>>
>> -Denis
>>
>> It turns  out that I jumped to an  invalid conclusion.  The issue is not
>>     
> with bash, but with dash.   But my problem remains.  I need to use dash, and
> the policy wants the script to be sourced.  My only solution at this time is
> to have a separate script with the argument coded into it.  I would prefer
> not to do that, but even more I would like to understand the behavior.
>
> -Denis
>   
Dennis Heidtmann
Well, first let's see if we are on the same page ... OK?
    I run Mandriva 2008 and ...
    (1) /bin/sh -> bash
    (2) instead of /etc/gdm/PostSession/Default I have 
/etc/X11/gdm/PostSession/Default
    (2.1) I have included the text of /etc/X11/gdm/PostSession/Default 
below for comparison
    (3) if we are anywhere near on the same  page ... could you show me 
what you are trying to do?
... hoping to help
Regards
Fred James

[text of /etc/X11/gdm/PostSession/Default from Mandriva 2008]
#!/bin/sh

PATH="/usr/bin:$PATH:/bin:/usr/bin"
OLD_IFS=$IFS

gdmwhich () {
  COMMAND="$1"
  OUTPUT=
  IFS=:
  for dir in $PATH
  do
    if test -x "$dir/$COMMAND" ; then
      if test "x$OUTPUT" = "x" ; then
        OUTPUT="$dir/$COMMAND"
      fi
    fi
  done
  IFS=$OLD_IFS
  echo "$OUTPUT"
}

exit 0




More information about the PLUG mailing list