4

Possible Duplicate:
How do I get bash completion for command aliases?

I wrote a series of scripts to make package management a little more intuitive for me. However, I can no longer tab complete for package names. Is there a way I can forward the results of a tab completion to a script?

Sample- package-install:

#!/bin/bash

apt-get install $*
Lucretiel
  • 212
  • Make that apt-get install "$@". $* breaks the arguments into words, interprets them as wildcard patterns, then stitches the pieces back together. This may produce nonsensical results if the arguments contain whitespace or wildcard characters. "$@" replicates the script's arguments exactly. – Gilles 'SO- stop being evil' Nov 27 '12 at 23:34
  • This is such a simple script, you could make it an alias: alias package-install='apt-get install' (put this line in your ~/.bashrc). The solution for completing is the same whether you have a wrapper script or an alias. – Gilles 'SO- stop being evil' Nov 28 '12 at 00:18
  • I wanted it in a script for a couple reasons. One is that I want to distribute it via github to computers that I use in the future, and I want to add other OS's besides ubuntu. Another is that some of the scripts are more than one command, all of which require su or sudo. – Lucretiel Nov 29 '12 at 19:12

0 Answers0