+ # Desc: Lists working directory file basenames
+ # Usage: list_files
+ # Input: fext var file extension
+ # Output: stdout a line-delimited list of file names
+ if [[ -z "$fext" ]]; then
+ find . -mindepth 1 -maxdepth 1 -type f -exec basename '{}' \; ;
+ else
+ find . -mindepth 1 -maxdepth 1 -type f -exec basename '{}' \; \
+ | grep -E -- "${fext}$" ;
+ fi;
+}; # list pwd file basenames
+remove_leading_zeroes() {
+ # Desc: Removes leading zeroes from lines
+ # Input: stdin
+ # Output: stdout
+ # Depends: BK-2020-03 read_stdin()
+ # Version: 0.0.1
+ while read -r line; do
+ printf "%s\n" "$line" | sed -E -e 's/(^0*)([0-9].*)/\2/';
+ done;