mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 16:07:39 +00:00
2144381da4
Conflicts: drivers/md/Makefile lib/raid6/unroll.pl
20 lines
424 B
Awk
20 lines
424 B
Awk
|
|
# This filter requires one command line option of form -vN=n
|
|
# where n must be a decimal number.
|
|
#
|
|
# Repeat each input line containing $$ n times, replacing $$ with 0...n-1.
|
|
# Replace each $# with n, and each $* with a single $.
|
|
|
|
BEGIN {
|
|
n = N + 0
|
|
}
|
|
{
|
|
if (/\$\$/) { rep = n } else { rep = 1 }
|
|
for (i = 0; i < rep; ++i) {
|
|
tmp = $0
|
|
gsub(/\$\$/, i, tmp)
|
|
gsub(/\$\#/, n, tmp)
|
|
gsub(/\$\*/, "$", tmp)
|
|
print tmp
|
|
}
|
|
}
|