FS#3835 - bash-completion, sed: -e expression #1, char 20: unterminated `s' command

Attached to Project: Arch Linux
Opened by Benny Kjellgren (benny) - Wednesday, 25 January 2006, 10:01 GMT
Last edited by Dale Blount (dale) - Wednesday, 25 January 2006, 13:08 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Aurelien Foret (aurelien.foret)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7.1 Noodle
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

completion of scp and ssh
sed: -e expression #1, char 20: unterminated `s' command
This task depends upon

Closed by  arjan timmerman (blaasvis)
Saturday, 25 March 2006, 16:51 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in bash-3.1-2
Comment by Benny Kjellgren (benny) - Thursday, 26 January 2006, 09:22 GMT
With DEBUG=1 I found that it is line 8313 in /etc/bash_completion :
hosts=$( compgen -W "$( sed -ne "s/^[Hh][Oo][Ss][Tt]["$'\t '"]*\([^*?]*\)$/\1/p" ${config[@]} )" -- $ocur )

Here is the tail of the debug :
---
compgen -W "$( sed -ne "s/^[Hh][Oo][Ss][Tt][" "]*\([^*?]*\)$/\1/p" ${config[@]} )" -- $ocur
sed -ne "s/^[Hh][Oo][Ss][Tt][" "]*\([^*?]*\)$/\1/p" ${config[@]}
sed: -e expression #1, char 20: unterminated `s' command
---

I guess that the [" "] cause the error

//bennny
Comment by Benny Kjellgren (benny) - Thursday, 26 January 2006, 10:45 GMT
Remove the outer " from this line I do not get the 'sed' error. Now Im sure this is the line that cause the 'sed' error.

- hosts=$( compgen -W "$( sed -ne "s/^[Hh][Oo][Ss][Tt]["$'\t '"]*\([^*?]*\)$/\1/p" ${config[@]} )" -- $ocur )
+ hosts=$( compgen -W $( sed -ne "s/^[Hh][Oo][Ss][Tt]["$'\t '"]*\([^*?]*\)$/\1/p" ${config[@]} ) -- $ocur )

But I do not get "aliases" ("Host" in .ssh/config) when doing tab completion of 'ssh'.

//benny
Comment by Benny Kjellgren (benny) - Thursday, 26 January 2006, 11:14 GMT
I can make it work by doing :

hosts=$( sed -ne "s/^[Hh][Oo][Ss][Tt]["$'\t '"]*\([^*?]*\)$/\1/p" ${config[@]} )
hosts=$( compgen -W "$hosts" -- $ocur )
Comment by kronin (kronin) - Friday, 03 February 2006, 00:24 GMT
see here:
http://lists.gnu.org/archive/html/bug-bash/2006-01/msg00033.html

here is a patch, that solves this

Loading...