My Computer Tips was launched in 2015 and provides information for common tasks in various Linux distributions and other computer related subjects.
My Computer tips has over 290 tutorials and tips.
If you found the information on My Computer Tips useful, please consider sharing our site details.
ID: 351
Category: Bash Scripts
Added: 5th of June 2023
Views: 1,565
The bash script allows the user to create, add, clear and delete a .txt file using a simple menu in the terminal.
The bash script gets user input using the read -n1 command which is assigned to the opt variable. The -n1 switch limits the input to 1 character.
The bash script uses other elements including a function, if elif and else statement.
Copy and paste the code below to a new text file. Save the file as menu.sh then make the script executable by entering the following in the terminal
Linux Forums
Linux Gaming
Other Linux / Computer Sites
Other Sites / Shopping