Questions about command completion in the Bash Unix shell.
Questions tagged [bash-completion]
310 questions
0
votes
1 answer
where do I install custom completions for a python command line script on OSX
In the bash-completions read me it states:
Q. I author/maintain package X and would like to maintain my own
completion code for this package. Where should I put it to be sure
that interactive bash shells will find it and source it?
Install it…

bjw
- 2,046
- 18
- 33
0
votes
1 answer
Copying files in bash
Im learning bash and I have a question about how to copy files from fatherly folder into another folder when user types "0". (for example from K2 to K1) And I don't know how to do so.
#!/bin/bash
echo $1 $2 $3 $4
K1=$1
K2=$2
if [ $4 -eq "0" ]…

user2961021
- 29
- 6
0
votes
2 answers
Interpolate variables in path (bash command line)
Please, tell me, what should i do , to interpolate variable name in bash command line while I type it?
i.e. $A = ~/tmp/
in tmp folder I have tmp1 and tmp2 folders.
I type: cd $A and nothing happes.
if i put additional / and type cd $A/tmp1, it…

ZhekakehZ
- 147
- 1
- 1
- 7
0
votes
1 answer
Print all commands with pathnames
I am trying to print all of the program file names on a system accessable from bash. (eg the path)
I have been using 'which $(compgen -c)' but that does not seem efficient. Is there a better way?

user2697383
- 25
- 6
0
votes
1 answer
Makefile bash autocompletion issue with PHP generated targets
In a large Makefile managed project, I recently added some PHP generated targets and bash completion stopped working: pressing [tab] does not trigger completion, but inserts a tab character.
I isolated the issue to this minimal Makefile:
# TARGETS =…

Stefaan
- 4,696
- 3
- 23
- 16
0
votes
2 answers
Any bash/rails plugin to autocomplete/suggest migration versions?
Every time I have to run/redo a particular migration in my rails app, I have to go through the following steps to obtain the exact version number:
grep - Search the files in the db/migrate folder containing the model/table name that I need,…

sridharraman
- 365
- 1
- 4
- 16
0
votes
2 answers
bash completion isn't working like it used to -- not escaping spaces and oddities in filenames, etc
Okay, I just don't understand why this isn't working automatically.
When I'm working on my mac, spaces and other odd characters get escaped automatically when I do autocomplete in bash, but on my ubuntu box, they don't. Even worse, if I do escape…

tamouse
- 2,169
- 1
- 19
- 26
0
votes
0 answers
macosx lion bash tab completion for directories takes ages
At work, I have to wait 1s~5s for dir completion in iterm2. Same mba, but at home it works instantly.

ptica
- 749
- 8
- 16
0
votes
1 answer
Bash completion for strings with spaces and punctuation
I'm trying to write a bash completion function that works for strings containing spaces and punctuation, even quotes may be in there.
I extract these strings with sed from files and thus have them as a several lines of text where each one contains a…

Michael Schuerig
- 137
- 1
- 6
-1
votes
1 answer
Failure to get bash completions when using the optcomplete module
I am trying to use python-optcomplete package (1.2-11.1 from Debian Testing):
$ cat /etc/bash_completion.d/optcomplete
_optcomplete()
{
COMPREPLY=( $( \
COMP_LINE=$COMP_LINE COMP_POINT=$COMP_POINT \
COMP_WORDS="${COMP_WORDS[*]}" …

tshepang
- 12,111
- 21
- 91
- 136
-1
votes
1 answer
Im trying to get users input in Bash
I need a command that can ask the user for input and do something with the resuld such as run if they answer with a specific result.
I tried
read -p
and i cant get input to work and i despretly need it
-1
votes
2 answers
What's the meaning of “the initial non-assignment word on the line” in shell
In Programmable Completion Builtins complete command, there is a -I argument.
It said:
The -I option indicates that other supplied options and actions should apply to completion on the initial non-assignment word on the line, or after a command…

tinyhare
- 2,271
- 21
- 25
-1
votes
4 answers
bash code to count A to z char with count string input string and give output in new string
Hi folks just started write code in bash but stuck in my own question in want to count a to alphabets repetation in string like
read -p 'enter the string' str # SUPPOSE STRING USER ENTER IS
input = AAASSSSFFRREEE
i wanna get output…

babybash
- 13
- 3
-1
votes
1 answer
Bash script to ssh into multiple machines, each executing different commands
I have 3 ec2 machines, and on each machines I have to run some server. So I am trying to create a bash script to accomplish the task. sample script
ssh -t ubuntu@server1 << EOL
start server1
EOL
ssh ubuntu@server2 << EOL
start server2
EOL
ssh…

iron_man83
- 67
- 2
- 9
-1
votes
1 answer
bash script with asynchronous while loop
I have the following bash script.
your_token=tokenAddress
number_to_airdrop=1
echo "Starting transfering"
while IFS= read -r line
do
spl-token transfer $your_token $number_to_airdrop $line --allow-unfunded-recipient --fund-recipient
done <…

Nika Kurashvili
- 6,006
- 8
- 57
- 123