Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added usage of case in bash #99

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bash/case.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
echo "Do you know how to contribute to open source projects?"
read -p "Yes/No: " response
case $response in
Yes|yes|YES)
echo "Thats great, you can also contribute to this repo"
;;
No|no|NO)
echo "You can follow this https://github.com/firstcontributions/first-contributions"
echo "Then come back here and start contributing"
;;
esac
echo -e "\n\nThank You"
11 changes: 11 additions & 0 deletions bash/text_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
total 9
-rwxr-xr-x 1 Khagapati 197121 391 Oct 2 09:50 arithmatic.sh
-rwxr-xr-x 1 Khagapati 197121 418 Oct 2 10:59 case.sh
-rwxr-xr-x 1 Khagapati 197121 403 Oct 1 23:09 for_loop.sh
-rwxr-xr-x 1 Khagapati 197121 33 Oct 1 22:58 hello_world.sh
-rwxr-xr-x 1 Khagapati 197121 86 Oct 2 22:46 read_from_a_file.sh
-rw-r--r-- 1 Khagapati 197121 0 Oct 2 22:46 text_file.txt
-rwxr-xr-x 1 Khagapati 197121 138 Oct 1 22:58 use_echo.sh
-rwxr-xr-x 1 Khagapati 197121 83 Oct 1 22:58 user_input.sh
-rwxr-xr-x 1 Khagapati 197121 125 Oct 1 22:58 while_loop.sh
-rwxr-xr-x 1 Khagapati 197121 130 Oct 2 22:45 write_to_a_file.sh
6 changes: 6 additions & 0 deletions bash/write_to_a_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
#Create output file, override if already present
output=text_file.txt

#Write data to a file
ls -l> $output