Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need code to print message if software doesn't install then continue to next software

Status
Not open for further replies.

DoraSmith24

Technical User
Oct 9, 2019
1
US
I'm not an IT pro but a bash beginner with basic programming knowledge.

I have a question I can't find the answer to in Google or in books about bash scripting.

I want to write a bash script that installs a list of software, codecs, and utilities.

I am running into a problem because if a script can't find a specific item it just installs everything to that point and stops, and you don't even know what actually installed. Scripts to do the same thing written by other people run into the same problem. The script probably worked when they ran it but some things can't be located in the same place any more.

I need the code to do the following.

Install gimp.

If gimp installed, print 'Installed GIMP' to filename.

If gimp did NOT install, then:
----- do not terminate the script
----- print 'did not install GIMP'.

Thanks!

Yours,
Dora Smith
 
You did not specify, how you install Gimp, so it is difficult to recommend a suitable solution. Usual install scripts return a non-zero exit code, which you might want to catch. Others might output something to stderr to indicate failure, so you can evaluate this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top