Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneKornev committed Oct 1, 2024
1 parent c1e92ae commit 5bfe68d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions solution/addsuffix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /bin/bash

for ((i = 2; i <= $#; i++)); do
mv $"${!i}" $"${!i}$1"
done
16 changes: 16 additions & 0 deletions solution/fizzbuzz.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/bash

for ((i = 1; i <= $1; i++)); do
a=$(($i%3))
b=$(($i%5))
c=$(($i%15))
if [[ c -eq 0 ]]; then
echo Fizz Buzz
elif [[ b -eq 0 ]]; then
echo Buzz
elif [[ a -eq 0 ]]; then
echo Fizz
else
echo $i
fi
done
3 changes: 3 additions & 0 deletions solution/reverse
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

tac $1
7 changes: 7 additions & 0 deletions solution/untar
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

input=$"$1"
directory=$"$input.unpacked"
rm -rf $"$directory"
mkdir $"$directory"
tar -xf $"$input" -C $"$directory"

0 comments on commit 5bfe68d

Please sign in to comment.