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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.