Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Whenever I open my terminal I get this error at the top:

bash: /etc/bash_completion.d/hping2: line 22: syntax error near unexpected token `$( compgen -W '02 04 08 10' )'
bash: /etc/bash_completion.d/hping2: line 22: `            $COMPREPLY=( $( compgen -W '02 04 08 10' ) )'
share|improve this question
    
Could you please post the ~/.bashrc and ~/.profile? –  quanta Oct 8 '11 at 13:53
    
bashrc - pastebin.com/7kBFNTT9 profile pastebin.com/HaeHrpeX –  Terra Oct 8 '11 at 13:58
    
and the snippet of /etc/bash_completion.d/hping2 around the line 22? –  quanta Oct 8 '11 at 14:06
    
full script - pastebin.com/6pBartwz –  Terra Oct 8 '11 at 14:39

2 Answers 2

up vote 1 down vote accepted

Remove the dollar sign at the begin of the line 22 and try again:

COMPREPLY=( $( compgen -W '02 04 08 10' ) )
share|improve this answer
    
It worked. Thank you. Do you have any idea what might have caused it? –  Terra Oct 8 '11 at 15:18
    
It resides in /etc, which meant that unless it's been manually been modified, it may have been caused by an buggy update. Have you made an on your OS? In fact, what OS are you running? –  Rilindo Oct 8 '11 at 19:45

This is caused by, ahem, a syntax error in one of the bash completion scripts (in this case it is the completion script for hping2). When the terminal starts a program called bash to handle your terminal session, bash run its initialization scripts, including the completion script /etc/bash_completion.d/hping2.

For some reason, that script on your computer is messed up (maybe somebody accidentally edited it), resulting in the syntax error. I think the right way to fix it would be to change that line to

COMPREPLY=( $( compgen -W '02 04 08 10' ) )

(remove the $ at the beginning of the line).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.