diff --git a/Introduction-to-Data-Science/Week-1/Yashas/Assignment1.sh b/Introduction-to-Data-Science/Week-1/Yashas/Assignment1.sh new file mode 100755 index 0000000..5cc940d --- /dev/null +++ b/Introduction-to-Data-Science/Week-1/Yashas/Assignment1.sh @@ -0,0 +1,9 @@ +STAR=$(head -3 file.txt|grep the|wc -l) +lines=$(grep -c ^ file.txt) +q=$(expr "$lines" - "3") +DIAMOND=$(tail -$q file.txt| grep "for"|wc -l) +sed -i '1,3s/the/it/g' file.txt +sed -i '4,$s/for/when/g' file.txt +sort -r file.txt +COST=$(expr $(expr $STAR \* $STAR) + $DIAMOND) +echo "$COST" diff --git a/Week-1/Yashas/Assignment1.sh b/Week-1/Yashas/Assignment1.sh new file mode 100755 index 0000000..5cc940d --- /dev/null +++ b/Week-1/Yashas/Assignment1.sh @@ -0,0 +1,9 @@ +STAR=$(head -3 file.txt|grep the|wc -l) +lines=$(grep -c ^ file.txt) +q=$(expr "$lines" - "3") +DIAMOND=$(tail -$q file.txt| grep "for"|wc -l) +sed -i '1,3s/the/it/g' file.txt +sed -i '4,$s/for/when/g' file.txt +sort -r file.txt +COST=$(expr $(expr $STAR \* $STAR) + $DIAMOND) +echo "$COST"