This completion function worked in previous versions, but fails in
    bash4.0 when I press TAB:

_cpsh() {
    COMPREPLY=( `
        cd "$HOME/scripts" || return 3
        printf "%s\n" ${COMP_WORDS[$COMP_CWORD]}*-sh`
    )
    COMPREPLY=( "${comprep...@]%-sh}" )
  }
complete -F _cpsh cpsh


     This is what happens:

$ cpsh <TAB>
malloc: ./parse.y:5563: assertion botched
free: called with unallocated block argument
last command: _cpsh() {
  COMPREPLY=( `
      cd "$HOME/scripts" || return 3
      printf "%s\n" ${COMP_WORDS[$COMP_CWORD]}*-sh`
  )
  COMPREPLY=( "${comprep...@]%-sh}" )
}
Aborting...Aborted

--
   Chris F.A. Johnson, webmaster         <http://woodbine-gerrard.com>
   ===================================================================
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)


Reply via email to