Let's say I thought I had SVN installed. I run the command and I get the following output:

aoneill@aoneill-Laptop:~/Documents$ svn
The program 'svn' is currently not installed. You can install it by typing:
sudo apt-get install subversion

My question is: Can I change the output, or catch such a situation, to say something like the following, with a prompt at the end?

aoneill@aoneill-Laptop:~/Documents$ svn
The program 'svn' is currently not installed. You can install it by typing:
sudo apt-get install subversion

Install the package? [y/n]

Thank you! It would make package handling that much nicer!

有帮助吗?

解决方案

Exactly what you are looking for:

export COMMAND_NOT_FOUND_INSTALL_PROMPT=1
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top