eval {
local $_ = $_[1];
s/\A[0-9]+\z/(?:\\S*\\h+){$_}\\K/;
- s/\A[+]([0-9]*)\z/(?:\\d+\\D+\\b){$1}\\K \\s* (?=\\d)/;
+ s{\A[+]([0-9]*)\z}{
+ (!!$1 && '(?:\d+\D+\b){'.$1.'}\K') . '\s* (?=\d)'
+ }e;
$opt{anchor} = qr/$_/;
} or die $@ =~ s/(?:\ at\ \N+)?\Z/ for option $_[0]/r;
},
Same from formatted results, selecting the first numeric value:
- tree -s --noreport | barcat -H -f+0
+ tree -s --noreport | barcat -H -f+
+
+Compare media metadata, like image size or play time:
+
+ exiftool -T -p '$megapixels ($imagesize) $filename' * | barcat
+
+ exiftool -T -p '$duration# $avgbitrate# $filename' * | barcat -H
+
+ find -type f -print0 | xargs -0 -L1 \
+ ffprobe -show_format -of json -v error |
+ jq -r '[.format|.duration,.bit_rate,.filename]|join(" ")' | barcat -H
Memory usage of user processes with long names truncated: