Question: Linux Imagine that you want to store all the errors generated by your script into an error log. Currently, you'd have to add 2>>error Log
Linux
Imagine that you want to store all the errors generated by your script into an error log. Currently, you'd have to add 2>>error Log to every line that may produce an error. Instead, you can tell the script to redirect a specific input/output for the duration of the whole script using exec . For example, exec 1>test out redirects the default/normal output to a file test out , for the whole script. Write a script that takes 2 arguments: a file, and a folder. It moves that file to that folder, without te sting anything about them , or displaying any message. If errors occurred, your script will ask the user whether he/she wants to read them (Y/N) and, if so, it will display them. Use exec in this script.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
