Skip to content

Commit

Permalink
Merge pull request #3 from Aby-Sebastian/bash
Browse files Browse the repository at this point in the history
corrected errors
  • Loading branch information
Aby-Sebastian authored Oct 21, 2020
2 parents 8cf4e34 + acbbcbe commit 5f6524f
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Linux Shell/A Personalized Echo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#One line: "Welcome (name)" (quotation marks excluded).
#The evaluation will be case-sensitive.

#!/bin/bash

read name
echo "Welcome $name"

6 changes: 3 additions & 3 deletions Linux Shell/Arithmetic Operations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

# 17.929

#!/bin/bash

read p1
read p2
read p3

printf "%.3f\n" `echo $p1 | bc -l`
printf "%.3f\n" $(echo "$p1" | bc -l)

2 changes: 2 additions & 0 deletions Linux Shell/Comparing Numbers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#- X is greater than Y
#- X is equal to Y

#!/bin/bash

read firstNumber
read secondNumber
if (($firstNumber > $secondNumber)); then
Expand Down
2 changes: 2 additions & 0 deletions Linux Shell/Getting started with conditionals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@

# echo YES or NO to STDOUT.

#!/bin/bash

read c
[[ "$c" == [yY] ]] && echo "YES" || echo "NO"
2 changes: 2 additions & 0 deletions Linux Shell/Let's Echo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@

#HELLO

#!/bin/bash

echo "HELLO"
3 changes: 2 additions & 1 deletion Linux Shell/Looping and Skipping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
#.
#99

#!/bin/bash

for i in {1..99..2}
do
echo $i
echo "$i"
done

2 changes: 2 additions & 0 deletions Linux Shell/Looping with Numbers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#.
#50

#!/bin/bash

X=1
while [ $X -le 50 ]
do
Expand Down
1 change: 1 addition & 0 deletions Linux Shell/More on Conditionals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# One word: either "SCALENE" or "EQUILATERAL" or "ISOSCELES" (quotation marks excluded).

#!/bin/bash

read c1
read c2
Expand Down
6 changes: 3 additions & 3 deletions Linux Shell/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Linux Shell


- [Let's Echo](https://github.com/Aby-Sebastian/Hackerrank-Codes/blob/add-c/Linux%20Shell/Let's%20Echo.sh)
- [Looping and Skipping](https://github.com/Aby-Sebastian/Hackerrank-Codes/blob/add-c/Linux%20Shell/Looping%20and%20Skipping.sh)
- [Middle of a Text File](https://github.com/Aby-Sebastian/Hackerrank-Codes/blob/add-c/Linux%20Shell/Middle%20of%20a%20Text%20File.sh)
- [Let's Echo](https://github.com/Aby-Sebastian/Hackerrank-Codes/blob/add-c/Linux%20Shell/Let's%20Echo.sh)
- [Looping and Skipping](https://github.com/Aby-Sebastian/Hackerrank-Codes/blob/add-c/Linux%20Shell/Looping%20and%20Skipping.sh)
- [Middle of a Text File](https://github.com/Aby-Sebastian/Hackerrank-Codes/blob/add-c/Linux%20Shell/Middle%20of%20a%20Text%20File.sh)
1 change: 1 addition & 0 deletions Linux Shell/The World of Numbers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#Four lines containing the sum (X+Y), difference (X-Y), product (X*Y), and quotient (X/Y), respectively.
#(While computing the quotient, print only the integer part.)

#!/bin/bash

read x
read y
Expand Down

0 comments on commit 5f6524f

Please sign in to comment.