|
@@ -3,6 +3,8 @@ |
|
|
# Description: An almost fully POSIX compliant batch file renamer |
|
|
# Description: An almost fully POSIX compliant batch file renamer |
|
|
# |
|
|
# |
|
|
# Note: nnn auto-detects and invokes this plugin if available |
|
|
# Note: nnn auto-detects and invokes this plugin if available |
|
|
|
|
|
# Whitespace is used as delimiter for read. |
|
|
|
|
|
# The plugin doesn't support filenames with leading or trailing whitespace |
|
|
# |
|
|
# |
|
|
# Capabilities: |
|
|
# Capabilities: |
|
|
# 1. Basic file rename |
|
|
# 1. Basic file rename |
|
@@ -43,7 +45,10 @@ else |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
printf "%s" "$arr" | awk '{print NR " " $0}' > "$dst_file" |
|
|
|
|
|
|
|
|
lines=$(printf "%s\n" "$arr" | wc -l) |
|
|
|
|
|
width=${#lines} |
|
|
|
|
|
|
|
|
|
|
|
printf "%s" "$arr" | awk '{printf("%'"${width}"'d %s\n", NR, $0)}' > "$dst_file" |
|
|
|
|
|
|
|
|
items=("~") |
|
|
items=("~") |
|
|
while IFS='' read -r line; do |
|
|
while IFS='' read -r line; do |
|
|