0

This question was inspired by that one.

I've understood how to execute utils from C or C++ code. But how can we handle, that the command can't be executed because of some packages that are not installed and what exactly they are?

For example: if I call some command (that is not installed) from terminal, I'll see a message about it and suggestions about packages, where I can find it. How to get it in code to show user, or to call installation, or to do something else?

Community
  • 1
  • 1
VALOD9
  • 566
  • 2
  • 6
  • 22
  • How do you want to handle such cases? It's up to you to decide how your parent program *should* react when (for example) a child program executes longer than expected. From there you might want to ask about (for example) how to go about implementing what you decide you want, but we can't really guess what you're likely to want. – Jerry Coffin Nov 13 '14 at 15:34
  • You have two independent questions here. You need to decide which you want answered here, and which you will open a new question for. – Ignacio Vazquez-Abrams Nov 13 '14 at 15:35
  • @JerryCoffin, if I call a command that is in the package, that is not installed, I'll see a message about it (with the name of package where I can find that command). So, I am wondering how to get that message in code? – VALOD9 Nov 13 '14 at 15:40
  • @IgnacioVazquez-Abrams, just a second:) – VALOD9 Nov 13 '14 at 15:41
  • Programs like `top` show pretty screens to humans. Their output is not meant to be processed by tools, and they may actually refuse to work if you try to run them like that. – n. m. could be an AI Nov 13 '14 at 15:46
  • @IgnacioVazquez-Abrams, done. Another question will be added after 90 minutes end. – VALOD9 Nov 13 '14 at 15:47

0 Answers0