diff --git a/Lab2/for.sh b/Lab2/for.sh new file mode 100755 index 0000000000000000000000000000000000000000..01085c6fdf710931aa12f6607d32d735757316cd --- /dev/null +++ b/Lab2/for.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +for i in {1..10} +do + echo Hello $i +done diff --git a/Lab2/for2.sh b/Lab2/for2.sh new file mode 100755 index 0000000000000000000000000000000000000000..598fcc77abb7c0dea22a7c9465a074fc2f42f62b --- /dev/null +++ b/Lab2/for2.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +for file in ./* +do + numLines=$(wc -l < $file) + echo The file $file contains $numLines lines of text +done diff --git a/Lab2/hello.sh b/Lab2/hello.sh new file mode 100755 index 0000000000000000000000000000000000000000..485e2f637a84494cae0b1e7f5870996ab7ce8b6e --- /dev/null +++ b/Lab2/hello.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello world!" diff --git a/Lab2/var.sh b/Lab2/var.sh new file mode 100755 index 0000000000000000000000000000000000000000..b2a1433a918cddfddfb4e8eca0c0c369d8abba75 --- /dev/null +++ b/Lab2/var.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +#Set a variable +exampleVariable=600 + +#Print out the result +echo The value of the variable is $exampleVariable diff --git a/Lab2/var2.sh b/Lab2/var2.sh new file mode 100755 index 0000000000000000000000000000000000000000..e273414a3bc099b47e04e39cde54b350fbccb1ba --- /dev/null +++ b/Lab2/var2.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +#Set a variable +exampleVariable=$(./hello.sh) + +#Print out the result +echo The value of the variable is $exampleVariable