style(user/bkytpldl-generic):Adjust comment
[BK-2020-03.git] / unitproc / bkt-remove_leading_zeroes
... / ...
CommitLineData
1#!/bin/bash
2
3remove_leading_zeroes() {
4 # Desc: Removes leading zeroes from lines
5 # Input: stdin
6 # Output: stdout
7 # Depends: BK-2020-03 read_stdin()
8 # Version: 0.0.2
9 while read -r line; do
10 printf "%s\n" "$line" | sed -E -e 's/(^0*)([0-9].*)/\2/';
11 done;
12};
13
14printf "00000.jpg\n0001.jpg\n2.jpg\n000003.jpg\n0010.jpg\n";
15printf "========================\n";
16printf "00000.jpg\n0001.jpg\n2.jpg\n000003.jpg\n0010.jpg\n" | remove_leading_zeroes;
17