LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-02-2008, 01:29 AM   #1
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Bash auto-completion question


So I noticed something odd the other day. My bash (Debian lenny) will autocomplete commands for me, as expected. However, for some commands, it will also autocomplete the options. For, example, if I type "dd ib" and then hit tab, it will complete to "dd ibs=".

How do these programs go about notifying bash of their options? Is there some method of pre-registering? Or are all of these commands actually bash builtins?
 
Old 05-02-2008, 01:51 AM   #2
GosthMan
LQ Newbie
 
Registered: Dec 2005
Distribution: Debian Sarge,Ubuntu,RHE 5, Gentoo,CentOS 5
Posts: 24

Rep: Reputation: 15
yes you can make add commands to bash completition using alias
Example:
alias "ps-status"="ps aux"
this will add the command ps-status to bash
Or if you have an custom made bash script you can create an simlink to /sbin/
 
Old 05-02-2008, 01:56 AM   #3
elliott678
Member
 
Registered: Mar 2005
Location: North Carolina
Distribution: Arch
Posts: 977

Rep: Reputation: 74
It should be the same in Debian as it is in Arch, check out /etc/bash_completion and maybe /etc/bash_completion.d/ if it exists.

Last edited by elliott678; 05-02-2008 at 01:58 AM.
 
Old 05-02-2008, 11:31 PM   #4
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148

Original Poster
Blog Entries: 1

Rep: Reputation: 48
That makes a lot more sense now, thanks! I didn't know about that config file, cool.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
TAB Auto Completion rsmccain Linux - Software 6 11-20-2007 09:47 PM
jdee auto completion xeon123 Linux - Software 1 03-16-2007 06:59 PM
question about bash completion Guest1234 Linux - Software 4 02-25-2006 04:09 PM
auto-completion in bash with wildcards juanbobo Linux - Software 2 04-07-2005 12:56 AM
auto-completion - how does it work & can my script args auto-complete? BrianK Programming 1 06-11-2004 04:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration