#Bash help requested
Posted: Sun Nov 11, 2018 3:42 am
I am hoping some Bash gurus out there could offer a hand.
I would like bash scripts to do the following tasks.
Note, the input to all these commands will be either 1 or more directory items (files or folders) and so I am assuming we will use "$@" as the input given I do not know in advance what the input will be or how many items we will have.
items 1 and 1a are placing things on the clipboard.
items 2 to 6 are renaming the item(s)
1. place the file name(s) (not the full path) in the clipboard
and
1a. place the file name(s) without extension (not the full path) in the clipboard
2. rename by remove all periods "." from a file/folder name(s) (just the name, not the extension)
3. rename by remove all periods "." from a folder name(s) and place parentheses around the first run of 4 digits
The.Old.Boys.2015.other.text.ext --> The Old Boys (2015) other text.ext
4. rename by replace all underscores "_" in a file name(s) with periods "." (just the name, not the extension)
5. rename by the following transformation on a folder name(s).
"The Old Boys (2015) other text.ext" --> "Old Boys, The (2015) other text.ext"
6.rename by capitalizing a file/folder name(s).
the.old.boys.2015.other.text.ext --> The.Old.Boys.2015.Other.Text.ext
Thank you in advance.
James
I would like bash scripts to do the following tasks.
Note, the input to all these commands will be either 1 or more directory items (files or folders) and so I am assuming we will use "$@" as the input given I do not know in advance what the input will be or how many items we will have.
items 1 and 1a are placing things on the clipboard.
items 2 to 6 are renaming the item(s)
1. place the file name(s) (not the full path) in the clipboard
and
1a. place the file name(s) without extension (not the full path) in the clipboard
2. rename by remove all periods "." from a file/folder name(s) (just the name, not the extension)
3. rename by remove all periods "." from a folder name(s) and place parentheses around the first run of 4 digits
The.Old.Boys.2015.other.text.ext --> The Old Boys (2015) other text.ext
4. rename by replace all underscores "_" in a file name(s) with periods "." (just the name, not the extension)
5. rename by the following transformation on a folder name(s).
"The Old Boys (2015) other text.ext" --> "Old Boys, The (2015) other text.ext"
6.rename by capitalizing a file/folder name(s).
the.old.boys.2015.other.text.ext --> The.Old.Boys.2015.Other.Text.ext
Thank you in advance.
James