You are not logged in.
Hi all!
am I the only one experiencing this problem?
Basically after boot up i get this message on tty 1 (short version due to lack of copy/paste function):
/etc/bash_completion.d/git: line 123: syntax error near unexpected token "<".
Problem is i never touched that file in my life....
this is how it looks:
svn-remote.*.url)
svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value"
svn_url_pattern+="\\|$value"
upstream=svn+git # default upstream is SVN if available, else git
;;
esac
## !! The following is line 123
done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')
# parse configuration values
for option in ${GIT_PS1_SHOWUPSTREAM}; do
case "$option" in
git|svn) upstream="$option" ;;
verbose) verbose=1 ;;
legacy) legacy=1 ;;
esac
done
By the way, what does "<" do in bash?
Offline
Cape,
I have git 1.7.1.1-1 installed and my /etc/bash_completion.d/git doesn't look at all like yours.
I don't have the message, either.
Try to reinstall git.
Mektub
Follow me on twitter: https://twitter.com/johnbina
Offline
this is the entire expression, and it looks like proper bash:
107 # get some config options from git-config
108 while read key value; do
109 case "$key" in
110 bash.showupstream)
111 GIT_PS1_SHOWUPSTREAM="$value"
112 if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then
113 p=""
114 return
115 fi
116 ;;
117 svn-remote.*.url)
118 svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value"
119 svn_url_pattern+="\\|$value"
120 upstream=svn+git # default upstream is SVN if available, else git
121 ;;
122 esac
123 done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')
while read var; do ... done < <(something) just tells bash to read var from the 'something' process in the <( ).
similarly, while read var; do ... done < ./file would read from the lines of the file.
BIG EDIT sorry guys, i had copy/pasted out of vim and cut off the second half of the pipe -- it looks like we all have the same expression and mine's not erroring... weird.
Last edited by brisbin33 (2010-07-26 13:58:40)
//github/
Offline
mmm... I've noticed that this file belongs to "git" package. And reinstalling git solved the problem. Now that file looks like yours. But how could it happened that pacman didn't synced it properly?
Offline
Oppss.. it's still giving me that message... Are we sure about the correctness of that line? Can it be an upstream problem?
Offline
Same problem here. Here's the entire error message (hand-copied, may have mistakes):-
/etc/bash_completion.d/git: line 123: syntax error near unexpected token `<'
/etc/bash_completion.d/git: line 123: ` done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')'
Line 123 is
done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')
which is different from brisbin33's version...
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
http://bugs.archlinux.org/task/20264
Yep, I've noticed it right after git upgrade...
Offline
edit -- removed, see my previous post
i know that done < <(process) is just as valid as done < $(process) and is much more efficient (no call to exec) so the fix listed in the bug tracker may not be ideal.
Last edited by brisbin33 (2010-07-26 13:59:16)
//github/
Offline
I tried to run "sh /etc/bash_completion.d/git" and the output is the same as in tty 1, while sourceing that same file with bash doesn't give any error...
Offline
Offline
It's still broken here. It looks pretty complicated now to fix, while I thought it was merely a broken git update.
One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.
Offline
also broken on my machine; same error:
[root@daasdingo-desktop /]# sh /etc/bash_completion.d/git
/etc/bash_completion.d/git: line 123: syntax error near unexpected token `<'
/etc/bash_completion.d/git: line 123: ` done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')'
as cape already reported, the problem probably is that this is bash-specific syntax; and the script is executed in sh.
[root@daasdingo-desktop daasdingo]# bash /etc/bash_completion.d/git
[root@daasdingo-desktop daasdingo]#
interesting link(reply to the previously posted mail):
it appears there is a bug in /etc/profile in archlinux that mis-detects
sh as bash and run bash specific script like bash_completion.
http://www.spinics.net/lists/git/msg136196.html
Last edited by daasdingo (2010-10-07 06:15:16)
Offline
Anyway to fix this error msg so far?
Arch Linux i686(kernel: 3.1.7-ck, xfce) running on Toshiba s100 (Pentium M 1.73GHz, 1.5GB RAM, 40GB HD, Nvidia 6600/6200 TE 64MB)
Offline
Installed Git few days ago and after throwing this error deleted it...
Nobody can/want fix it? Its 4 months old ...
Offline
At what point are your systems (automatically) sourcing the bash_completion files? I don't get this message at all.
I purposely source these files myself from ~/.bashrc which parses them correctly as bash. This means it doesn't error on the `< <( )` bashism.
If you really want to suppress the message, try putting #!/bin/bash at the top of bash_completion.d/git. A hack, but it should work.
Personally, I'd like to know why some "default setups" are sourcing this file and my "default setup" is not.
//github/
Offline