Changes

Jump to: navigation, search

Tutorial12: Shell Scripting - Part 2

1 byte removed, 20:47, 22 June 2021
LINUX PRACTICE QUESTIONS
# Add code to the script created in the <u>previous</u> question to force the user to enter only an '''integer''' to provide error-checking for this shell script.<br><br>
#Write code for a Bash shell script that will prompt the user for a '''valid POSTAL CODE'''.<br>A valid postal code consists of the following format: '''x#x #x#'''<br>where '''x''' represents an upper or lowercase letter<br>and '''#''' represents a number from 0-9<br><br>Also VALID postal codes can consist of no spaces or one or more spaces in the format shown above.<br><br>If the user enters an '''INVALID postal code''', indicate an error and allow the user to enter the VALID postal code. When the user enters a VALID postal code, then clear the screen and display the VALID postal code.<br><br>
# Write code that works similar to the previous question, but have it read an input file called '''unchecked-postalcodes.txt''' and only save VALID postal codes to a file called:<br>'''valid-postalcodes.txt'''<br><br>Design your Bash Shell script to only run if the user enters TWO ARGUMENTS:<br>'''unchecked-postalcodes.txt''' and '''valid-postalcodes.txt'''<br><br>Otherwise, display an error message and immediately exit your Bash Shell script with a false exit value.<br><br>
# What is the purpose of the '''/etc/profile''' startup file?<br><br>
# What is the purpose of the '''/etc/bashrc''' startup file?<br><br>
13,420
edits

Navigation menu