diff --git a/OS/bash/Week4/q2.sh b/OS/bash/Week4/q2.sh new file mode 100644 index 0000000..c99057c --- /dev/null +++ b/OS/bash/Week4/q2.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +echo "Deleteing the following files" + +for file in "$@";do +echo "$file" +rm -i "$file" +done + +echo "All files deleted successfully" diff --git a/OS/bash/Week4/q3.sh b/OS/bash/Week4/q3.sh new file mode 100644 index 0000000..4f9ac45 --- /dev/null +++ b/OS/bash/Week4/q3.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +selection_sort() +{ + local arr=("$@") # array declaration + local n=${#arr[@]} + + for ((i=0; i