diff --git a/bash/case.sh b/bash/case.sh new file mode 100644 index 0000000..44af2d5 --- /dev/null +++ b/bash/case.sh @@ -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" diff --git a/bash/text_file.txt b/bash/text_file.txt new file mode 100644 index 0000000..9941258 --- /dev/null +++ b/bash/text_file.txt @@ -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 diff --git a/bash/write_to_a_file.sh b/bash/write_to_a_file.sh new file mode 100644 index 0000000..882998b --- /dev/null +++ b/bash/write_to_a_file.sh @@ -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