mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-16 04:42:55 +08:00
Better commenting
This commit is contained in:
parent
20cf56518a
commit
0fd9ce6154
@ -1,11 +1,13 @@
|
||||
#!/bin/bash5
|
||||
#!/bin/bash
|
||||
|
||||
# Rename a set of files in current dir from .csv - portable and fairly simple
|
||||
# Utility to Rename a set of files in current dir using a .csv input file - portable and fairly simple
|
||||
# REQUIRES: awk, column
|
||||
# 2022.Dec Kingneutron
|
||||
|
||||
# HOWTO:
|
||||
# cd to dir you want to work on
|
||||
# Populate a temporary file with bare filenames (don't have to use ls, can use "find" or whatever)
|
||||
|
||||
# Populate a temporary file with bare filenames: (NOTE don't have to use ls, can use "find" or whatever)
|
||||
# ls -1 >tmp.csv
|
||||
|
||||
# Preprocess tmp file and add comma + duplicate filename:
|
||||
@ -14,7 +16,7 @@
|
||||
# Edit tmp file and replace 2nd filename after comma with preferred filename
|
||||
# IMPORTANT: Delete any lines that you DONT want renamed
|
||||
|
||||
# Run this script
|
||||
# Then Run this script
|
||||
|
||||
# failexit.mrg
|
||||
# REF: https://sharats.me/posts/shell-script-best-practices/
|
||||
@ -52,10 +54,11 @@ ls -lh $logf $errlog
|
||||
|
||||
exit;
|
||||
|
||||
# PROTIP: install detox package and run that on dir 1st # detox -v $PWD
|
||||
|
||||
# HOWTO:
|
||||
# $ ls -1 >tmp.csv # populate
|
||||
# cd to working dir 1st
|
||||
|
||||
# $ ls -1 >tmp.csv # populate temp output file (can also use find or whatever)
|
||||
wallpapersden.com_olivia-taylor-dudley-2018_2160x3840.jpg
|
||||
watchmen-youre-locked-in-here-with-me--fark_9jLJBkZ86xroJXgJl_PxH0pBQf8.jpg
|
||||
we-dont-need-no-stinkin-gadgets--fark_mqkB3Y1u50LMlRwXXyDPjOkwltw.jpg
|
||||
@ -66,6 +69,8 @@ xev-fark_SWJwl7Tm8mZKQydJ60dKAqVJlI0.jpg
|
||||
awk '{print $1",\t"$1}' tmp.csv |column -t >rename.csv
|
||||
#awk '{print $0",\t"$1}' tmp.csv >rename.csv
|
||||
|
||||
# Edit rename.csv and edit 2nd field = new filename to rename to
|
||||
|
||||
$ cat rename.csv
|
||||
we-beat-em-before-red-hat-nazis--fark_D0aakxPNV05v8A6OUS2P6AZAYms.jpg, we-beat-em-before-red-hat-naztis--fark_D0aakxPNV05v8A6OUS2P6AZAYms.jpg
|
||||
we-dont-need-no-stinkin-gadgets--fark_mqkB3Y1u50LMlRwXXyDPjOkwltw.jpg, we-dont-need-no-steenkin-gadgets--fark_mqkB3Y1u50LMlRwXXyDPjOkwltw.jpg
|
||||
|
Loading…
x
Reference in New Issue
Block a user