Subject: Re: [bash-completion] syntax error near unexpected token '<' on line 123 in bash_completion.d/git

From: solsTiCe d'Hiver <[email-masked]>
Date: Tue, 27 Jul 2010 11:24:15 +0200

Le lundi 26 juillet 2010 à 22:39 +0100, Andrew Sayers a écrit : 
> This time, could you tell me what the following debug messages print:
> 
> echo $BASHOPTS -- $SHELLOPTS -- $POSIXLY_CORRECT
> tr '\0' ' ' < /proc/$$/cmdline ; echo
> 
cmdhist:expand_aliases:extglob:extquote:force_fignore:interactive_comments:progcomp:promptvars:sourcepath -- braceexpand:hashshell:interactive-comments:posix -- y
/bin/sh /usr/sbin/gdm

> Could you also have a look at /bin/sh and any other files that might be
> (incorrectly?) symlinked to bash?
> 
I have included gdm in the DAEMON list in my /etc/rc.conf. I tried to
run it from inittab in a more usual way and get the same ?!

When I looked at /usr/sbin/gdm, I found the cause of this problem, look
at that

#!/bin/sh
#
# A script so that
#    1) we read the standard system env vars
#    2) syadmins/integrators can add their own private options etc...

test -f /etc/profile && . /etc/profile

# Make sure LANG is set
#
if [ -z "$LANG" ]
then
  if [ -f /etc/sysconfig/language ]
  then
    LANG=`. /etc/sysconfig/language; echo $RC_LANG`
    export LANG
  fi
fi

exec /usr/sbin/gdm-binary "$@"

Note: it's not a custom archlinux script. This is straight from gdm
release 2.30.4

so it's a non-login shell (sh) script that source /etc/profile and
breaks standard behavior. no wonder that bash_completion stuff is run
there