Question: Your assignment is to write a bash script named weather.bash that downloads three fixed GIF files, and pastes these together into a GIF animation. It

Your assignment is to write a bash script named "weather.bash" that downloads three fixed GIF files, and pastes these together into a GIF animation.

It should run in this manner:

[test@localhost bin]$ ./weather.bash out.gif # This invocation was successful, creating the below out.gif file [test@localhost bin]$ ./weather.bash out.gif bogus.gif # This invocation incorrectly named two output files Please give only one argument, the output file. USAGE: ./weather.bash OUTPUTFILE Your OUTPUTFILE will be a GIF file, so please use .gif as the terminal portion of the filename [test@localhost bin]$ ./weather.bash out.giff # This invocation incorrectly specified ".giff", not ".gif" USAGE: ./weather.bash OUTPUTFILE Your OUTPUTFILE will be a GIF file, so please use .gif as the terminal portion of the filename [test@localhost bin]$ ./weather.bash # This invocation incorrectly failed to specify an output file Please give only one argument, the output file. USAGE: ./weather.bash OUTPUTFILE Your OUTPUTFILE will be a GIF file, so please use .gif as the terminal portion of the filename

The source URLs for the GIF files to be pasted together are:

  • https://www.wpc.ncep.noaa.gov/basicwx/91fndfd_loop.gif
  • https://www.wpc.ncep.noaa.gov/basicwx/92fndfd_loop.gif
  • https://www.wpc.ncep.noaa.gov/basicwx/93fndfd_loop.gif

You may use curl, wget, or something more challenging to fetch the URLs (nc, for instance, would be a reasonably challenging tool; another, much more challenging one, would be telnet.)

Please include code to check to make sure that the three components are accessible (while these three files have been available for many years, many of their companion products have been discontinued, and, as the NWS continues to "modernize" its services, it will likely stop producing even these highly useful graphics.)

However, whichever method you use to fetch the GIF components, you may not make any temporary files. Instead, use the process substitution technique that we discussed on Wednesday to avoid creating any temporary files. Using temporary files is always a poor solution, and should be avoided in all of your programming tasks.

The server has a program "gifsicle" which will let you paste your three GIF files into a single GIF animation. When you run gifsicle, please make sure that you create an endless loop, and that your delay between frames is between 1 and 3 seconds (I used 1 second). Please note that gifsicle will complain about your input files, and will correctly suggest an additional option, which you should include.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!