String Conversion
In this challenge, you are tasked with writing a script that converts a string from lower case to upper case and from upper case to lower case based on user selection.
Tasks
You need to complete the following task:
- Write a script that converts the input string to upper case or lower case based on user selection.
Requirements
You must meet the following requirements:
- Use the
tr
command for string conversion.
- The script should be named
stringConv.sh
.
- Use the working directory
~/project
.
- Provide a filename through command-line input.
- Prompt the user for the conversion from lower to upper or upper to lower.
Example
labex:project/ $ bash stringConv.sh input_file.txt
[INPUT] Please Select an option [INPUT]
1.TO_UPPER_CASE
2.to_lower_case
1
[OUTPUT] Content of Input File AFTER OPERATION [OUTPUT]
THIS PROGRAM TAKES AN INPUT_FILE AS AN INPUT
AND CONVERTS THE STRING INTO UPPER_CASE
AND LOWER_CASE
labex:project/ $ bash stringConv.sh input_file.txt
[INPUT] Please Select an option [INPUT]
1.TO_UPPER_CASE
2.to_lower_case
2
[OUTPUT] Content of Input File AFTER OPERATION [OUTPUT]
this program takes an input_file as an input
and converts the string into upper_case
and lower_case