From b07985f5b4a9f699231bad2d8b3ed28bb3ed5890 Mon Sep 17 00:00:00 2001 From: Hrishabh Srivastava Date: Thu, 12 Jun 2025 12:08:52 -0700 Subject: [PATCH 1/2] Modified bash2.sh --- bash/bash2.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bash/bash2.sh b/bash/bash2.sh index 2f8a1f9..d22d387 100644 --- a/bash/bash2.sh +++ b/bash/bash2.sh @@ -1,2 +1,12 @@ -function countfiles() { -} +function countlines(){ +if [ $# == 0 ]; +then + echo "No arguments given. Usage: countfiles dir1 dir2 ..." +else + for i in $@ + do + echo $i has $(cd $i | ls -l | wc -l) files + done +fi + } + From 27ba2852ee3c0302ef37298471c411ce6ae07718 Mon Sep 17 00:00:00 2001 From: Hrishabh Srivastava Date: Thu, 12 Jun 2025 12:23:50 -0700 Subject: [PATCH 2/2] Modified bash2.sh --- bash/bash2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/bash2.sh b/bash/bash2.sh index d22d387..4482da8 100644 --- a/bash/bash2.sh +++ b/bash/bash2.sh @@ -5,7 +5,7 @@ then else for i in $@ do - echo $i has $(cd $i | ls -l | wc -l) files + echo $i has $(cd $i | ls -1a | wc -l) files done fi }