Skip to content

Commit

Permalink
edit .awk file path (#19)
Browse files Browse the repository at this point in the history
* add shellcheck

* edit shellcheck

* edit shellcheck

* add Git Guardian workflow

* Sync the master and dev branches (#16)

* edit shellcheck (#8)

* add shellcheck

* edit shellcheck

* edit shellcheck

* Update README.md (#9)

* Update README.md (#10)

* Update README.md (#11)

* Update README.md (#12)

* add Git Guardian workflow (#13)

* add shellcheck

* edit shellcheck

* edit shellcheck

* add Git Guardian workflow

* Update README.md (#14)

* Update README.md (#15)

* edit release badge

* add .gitignore file

* edit .awk file path
  • Loading branch information
meleksabit authored Oct 10, 2024
1 parent 97cfcfd commit c42a376
Showing 1 changed file with 34 additions and 36 deletions.
70 changes: 34 additions & 36 deletions files_info.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,42 @@ function usage() {
exit 1
}

LOC_SET=0 #0-location not set, use current location 1-location set
STATS=0 #0-do not display statistics 1-display statistics
LOC_SET=0 #0-location not set, use current location 1-location set
STATS=0 #0-do not display statistics 1-display statistics

while [ $# -gt 0 ]
do
while [ $# -gt 0 ]; do
case $1 in
-l|--location )
LOCATION="$2"
if ! [ -d "$LOCATION" ]; then
usage
fi
LOC_SET=1
shift
shift
;;

-e|--extension )
EXT="$2"
shift
shift
;;

-s|--stats )
STATS=1
shift
;;

-h|--help )
shift
usage
;;

* )
usage
;;
-l | --location)
LOCATION="$2"
if ! [ -d "$LOCATION" ]; then
usage
fi
LOC_SET=1
shift
shift
;;

-e | --extension)
EXT="$2"
shift
shift
;;

-s | --stats)
STATS=1
shift
;;

-h | --help)
shift
usage
;;

*)
usage
;;
esac


done

if [ $LOC_SET -ne 1 ]; then
Expand All @@ -65,9 +63,9 @@ if [ "$EXT" != "" ]; then
fi

#count size of files with specific extension
ls -l $LOCATION | awk '/^-/' | grep "\.$EXT$" | awk -v stats=$STATS -f /home/user/size.awk
ls -l $LOCATION | awk '/^-/' | grep "\.$EXT$" | awk -v stats=$STATS -f size.awk

else
ls -l $LOCATION | awk '/^-/' | awk -v stats=$STATS -f /home/user/size.awk
ls -l $LOCATION | awk '/^-/' | awk -v stats=$STATS -f size.awk

fi

0 comments on commit c42a376

Please sign in to comment.