Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/holland97/bash-case-statements
https://github.com/holland97/bash-case-statements
application-installation bash-functions case-statement user-group-management while-loop
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/holland97/bash-case-statements
- Owner: holland97
- Created: 2024-07-29T04:11:38.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-30T15:31:08.000Z (5 months ago)
- Last Synced: 2024-07-31T18:51:24.382Z (5 months ago)
- Topics: application-installation, bash-functions, case-statement, user-group-management, while-loop
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bash-Case-Statements
In my Bash project, I implemented a menu-driven script utilizing a while loop to repeatedly present a set of options to the user. Inside the loop, a case statement handles user input, executing specific commands based on the chosen option.1. Create a variable that'll be used in the conditional statement of the while loop.
``
variable-name=1
``2. Create the options to be displayed for the user, ``echo`` command will be used here.
3. Create a variable that will accept the input from the user``
read $usrinput
``4. Begin case statement with task that will be executed based on the option
``
case $usrinput in
``5. Once satisfied, you can exit the loop by hitting 6