From 733bcf95ac02b94bed219f15c12c766c1243f580 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Mon, 15 Jul 2024 21:33:05 +0000 Subject: [PATCH 1/1] chore(user/zeropad.sh):Add some comments --- user/zeropad.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/user/zeropad.sh b/user/zeropad.sh index 369d8c0..761fd30 100755 --- a/user/zeropad.sh +++ b/user/zeropad.sh @@ -4,8 +4,12 @@ # Version: 0.0.4 list_files() { + # Desc: Lists working directory file basenames + # Usage: list_files + # Input: none + # Output: stdout a line-delimited list of file names find . -mindepth 1 -maxdepth 1 -type f -exec basename '{}' \; ; -}; +}; # list pwd file basenames main () { # Find the maximum number of leading digits in the filenames of working dir max_digits="$(list_files | sed -e 's/[^0-9].*//' | awk '{ if(length > L) L=length } END { print L }')"; @@ -26,12 +30,9 @@ main () { mv -n "$file" "$new_file" # declare -p file new_file; # debug done < <(list_files); -}; +}; # main program main "$@"; - - - # Author: Steven Baltakatei Sandoval # License: GPLv3+ -- 2.30.2