3
Let’s say I have a script that asks for a user input as shown below
Digite o caminho do arquivo:
How do I make this input autocomplete the directory path in linux? I need this to avoid typos
3
Let’s say I have a script that asks for a user input as shown below
Digite o caminho do arquivo:
How do I make this input autocomplete the directory path in linux? I need this to avoid typos
0
The easiest way to do this is to include a shell script in /etc/bash_completion. d/. The basic structure of this file is a simple function that executes the completion and then the complete invocation which is a bash compiler. Instead of going into detail on how to use complete, I suggest you read an Introduction to Bash Completion. Part 1 covers the basics and Part 2 goes into how you would write a completion script.
Browser other questions tagged linux bash
You are not signed in. Login or sign up in order to post.
https://www.gnu.org/software/bash/bash.html#Programmable-Completion
– MagicHat