Bulk renamer shell script - Programming On Unix
Users browsing this thread: 1 Guest(s)
|
|||
I have just written an interactive POSIX shell script for bulk renaming files.
I think it might be useful for more people. When you call `bulkrename *`, it opens your favorite editor with the names of the files in the current directory for you to edit. Then, after closing the file, it renames the files to the names you edited. `ls | bulkrename` also works. Code: #!/bin/sh bulkrename(1) receives filenames from its arguments (one per argument) or from stdin (one per line) and opens an editor to edit them; then, it renames each file to the corresponding edited one. If there are no arguments, bulkrename operates on stdin, reading one filename per line. If there are arguments, each argument is read as a filename. The environment variables $EDITOR and $VISUAL are checked, in this order, for an editor program. If both are unset, use vi(1) by default. |
|||
Messages In This Thread |
Bulk renamer shell script - by seninha - 19-04-2020, 12:06 PM
RE: Bulk renamer shell script - by jkl - 20-04-2020, 08:04 AM
RE: Bulk renamer shell script - by seninha - 20-04-2020, 09:26 AM
RE: Bulk renamer shell script - by z3bra - 20-04-2020, 10:21 AM
RE: Bulk renamer shell script - by seninha - 20-04-2020, 10:28 AM
RE: Bulk renamer shell script - by z3bra - 20-04-2020, 03:45 PM
RE: Bulk renamer shell script - by jkl - 20-04-2020, 03:46 PM
RE: Bulk renamer shell script - by seninha - 20-04-2020, 04:11 PM
RE: Bulk renamer shell script - by ckester - 20-04-2020, 05:49 PM
|