style(user/bkytpldl-generic):Adjust comment
[BK-2020-03.git] / unitproc / bkt-remove_leading_zeroes
CommitLineData
bf9fed34
SBS
1#!/bin/bash
2
bf9fed34
SBS
3remove_leading_zeroes() {
4 # Desc: Removes leading zeroes from lines
5 # Input: stdin
6 # Output: stdout
7 # Depends: BK-2020-03 read_stdin()
55d2c6d0 8 # Version: 0.0.2
bf9fed34
SBS
9 while read -r line; do
10 printf "%s\n" "$line" | sed -E -e 's/(^0*)([0-9].*)/\2/';
55d2c6d0 11 done;
bf9fed34
SBS
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