Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Add bash script to convert string case
Browse files Browse the repository at this point in the history
  • Loading branch information
nmcc1212 committed Mar 1, 2024
1 parent 3772279 commit 0d6c05e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bashExercise/8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo "Enter a string"
read str
echo "1. Convert to upper case"
echo "2. Convert to lower case"
read choice
case $choice in
1) echo $str | tr 'a-z' 'A-Z' ;;
2) echo $str | tr 'A-Z' 'a-z' ;;
*) echo "Invalid choice" ;;
esac

0 comments on commit 0d6c05e

Please sign in to comment.