From 0de701828b3c2c51c971d4bf40c248f0e3b40571 Mon Sep 17 00:00:00 2001 From: Eric Roth <28618316+lifeeric@users.noreply.github.com> Date: Sun, 22 Dec 2019 08:33:39 -0500 Subject: [PATCH 1/4] Add in order to grasp it easily I was confused because of the copy part, so now I make it a bit possible to grasp easily! Please, keep these changes! --- Chapter01/script2.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Chapter01/script2.sh b/Chapter01/script2.sh index 66a3a77..fa7973a 100644 --- a/Chapter01/script2.sh +++ b/Chapter01/script2.sh @@ -1,3 +1,8 @@ # The script2.sh script #!/bin/bash -echo $name \ No newline at end of file +echo $name + +# second part + +name=shell # it updated the value of name variable but didn't update the original which comes from script1. +echo $name From db4a010e1a5470a1d4dae0a1f90d98300953285e Mon Sep 17 00:00:00 2001 From: Eric roth Date: Sun, 22 Dec 2019 08:46:11 -0500 Subject: [PATCH 2/4] fix --- Chapter01/Variable scope script1.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Chapter01/Variable scope script1.sh b/Chapter01/Variable scope script1.sh index b0905e3..3c7ce4c 100644 --- a/Chapter01/Variable scope script1.sh +++ b/Chapter01/Variable scope script1.sh @@ -2,4 +2,7 @@ #!/bin/bash name="Mokhtar" export name # The variable will be accessible to other processes -./06-script2.sh \ No newline at end of file +./06-script2.sh + +# second part, we updated name variable in script2.h +echo $name # ouput: Mokhtar \ No newline at end of file From e23193afe45724a282c7fb60c800ef575b0ba296 Mon Sep 17 00:00:00 2001 From: Eric roth Date: Sun, 22 Dec 2019 08:47:10 -0500 Subject: [PATCH 3/4] improved --- Chapter01/Variable scope script1.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chapter01/Variable scope script1.sh b/Chapter01/Variable scope script1.sh index 3c7ce4c..537f11f 100644 --- a/Chapter01/Variable scope script1.sh +++ b/Chapter01/Variable scope script1.sh @@ -4,5 +4,5 @@ name="Mokhtar" export name # The variable will be accessible to other processes ./06-script2.sh -# second part, we updated name variable in script2.h +# second part, we updated name variable in script2.sh, let's what we see echo $name # ouput: Mokhtar \ No newline at end of file From 4ee10501faa32a017a16475dbe9e66b51f3e2c0b Mon Sep 17 00:00:00 2001 From: Eric roth Date: Mon, 23 Dec 2019 09:02:38 -0500 Subject: [PATCH 4/4] missing expercise --- Chapter02/prompt.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Chapter02/prompt.sh diff --git a/Chapter02/prompt.sh b/Chapter02/prompt.sh new file mode 100644 index 0000000..2531813 --- /dev/null +++ b/Chapter02/prompt.sh @@ -0,0 +1,5 @@ +#!/bin/bash +echo -n "Hello $(basename $0)! May I ask your name: " +read +echo "Hello $REPLY" +exit 0