Question: Q: Write a short bash script findlocation that takes a 6-digit prefix in the argument and displays the corresponding location. If the script receives no
Q: Write a short bash script findlocation that takes a 6-digit prefix in the argument and displays the corresponding location. If the script receives no argument or the argument is not a 6-digit prefix made only out of the digits 0 thru 9, the script must return an exit condition code signaling failure (e.g. by executing exit 1). If the script receives a correctly formatted argument but the prefix is not found in the nanpa file, the script must return an exit condition code signaling failure. Otherwise, the script must display the appropriate location (on stdout). The location must not be prefixed by the prefix nor followed by superfluous spaces. This means you have to format the line found the nanpa file before displaying it. You may use grep and sed for this script.

- X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
