From a8a9eb50e54edd99110b24cc69be95156d6d26cd Mon Sep 17 00:00:00 2001 From: liakorman1 Date: Fri, 7 Feb 2025 16:21:38 +0000 Subject: [PATCH 1/5] q1 and q2 were added --- q1.sh | 18 +++++++++++++++++- q2.sh | 11 +++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 q2.sh diff --git a/q1.sh b/q1.sh index f7ac848..7a147b5 100644 --- a/q1.sh +++ b/q1.sh @@ -1 +1,17 @@ -This is q1 answer +#a +awk 'END {print NR}' aliceinwonderland.txt +#works also: awk '{print $0}' aliceinwonderland.txt | wc -l + +#b +#I included first and last word in a sentence (it can be removed by i=2 and i Date: Sun, 9 Feb 2025 11:50:51 +0000 Subject: [PATCH 2/5] ex10 Lia korman --- q1.sh | 10 ++++------ q2.sh | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/q1.sh b/q1.sh index 7a147b5..81bef47 100644 --- a/q1.sh +++ b/q1.sh @@ -3,15 +3,13 @@ awk 'END {print NR}' aliceinwonderland.txt #works also: awk '{print $0}' aliceinwonderland.txt | wc -l #b -#I included first and last word in a sentence (it can be removed by i=2 and i Date: Sun, 9 Feb 2025 12:03:46 +0000 Subject: [PATCH 3/5] ex10 Lia korman --- q1.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/q1.sh b/q1.sh index 81bef47..4357563 100644 --- a/q1.sh +++ b/q1.sh @@ -12,4 +12,4 @@ awk '{OFS=" ";for (i=2; i Date: Sun, 9 Feb 2025 12:12:34 +0000 Subject: [PATCH 4/5] ex10 Lia korman --- q1.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/q1.sh b/q1.sh index 4357563..2b0d629 100644 --- a/q1.sh +++ b/q1.sh @@ -6,10 +6,10 @@ awk 'END {print NR}' aliceinwonderland.txt awk '{for(i=2;i Date: Sun, 9 Feb 2025 13:51:43 +0000 Subject: [PATCH 5/5] ex10 Lia korman --- q2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/q2.sh b/q2.sh index fb40d59..0987187 100644 --- a/q2.sh +++ b/q2.sh @@ -1,7 +1,7 @@ #a sed -En '/Sherlock|Holmes/p' sherlockholmes.txt | wc -l #b -sed -n 's/Sherlock/&\n/gp; s/Holmes/&\n/gp' sherlockholmes.txt | wc -l +sed -n 's/Sherlock/&\n/gp; s/Holmes/&\n/gp' sherlockholmes.txt | grep -Eo "Sherlock|Holmes" | wc -l #c sed 's/^/Hello:/' sherlockholmes.txt #d