I'm writing a bash script that downloads and compiles a program and I don't know what i should be looking up to accomplish what I want, so here I go...

What I want:

sudo pacstall -I program

What it does now

sudo pacstall -I

then I would type in program to install program.

So how do I get it to 'ask for input' after typing in the -I flag (I for install)? I'm very new to bash scripting so any help is appreciated.


2 Answers 2

echo -n 'Enter the package name: '
read package
test -n "$package" && sudo pacstall -I "$package"

Coming back to this a year later, this was a pretty stupid question. The answer is positional variables, like $1, $2, etc

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .