I've exhausted every search I could.
I'm trying to read a filename/path from the CLI using read
so I can link files for sorting in bulk. I've tried all sorts of things from quotation marks to none, trying to use eval to expand, and so many other things. None of them work.
Here's my script in it's current state:
#!/bin/bash
read -p "from? (explicit, folder/) " -e from
read -p "to? (explicit, folder/) " -e to
read -p "base filename before ep name? " -e formatOldStart
read -p "base filename after ep name? " -e formatOldEnd
...
lnFrom=$from$formatOldStart$currentEpisodeNumber$formatOldEnd
echo $lnFrom
#ln "$lnFrom" "$lnTo"
Here's an example usage:
$ from? (explicit, folder/) $HOME/archive/_DATA_ARCHIVE/.data/Example\ Complete\ Series\ +\ Movies\ \[Dual\ Audio\]/Example\ \[Dual\ Audio\ DVD\ 480p\]/
$ to? (explicit, folder/) $HOME/archive/_DATA_ARCHIVE/_video_storage/Anime/Shows/Example/Season\ 1/
$ base filename before ep name? \(Hi10\)_Example_-_
$ base filename after ep name? _(DVD_480p)_(a-S)_(*).mkv
And then here's the output:
$HOME/archive/_DATA_ARCHIVE/.data/Example Complete Series + Movies [Dual Audio]/Example [Dual Audio DVD 480p]/(Hi10)_Example_-_015_(DVD_480p)_(a-S)_(*).mkv
Here's the expected output:
/home/user/archive/_DATA_ARCHIVE/.data/Example Complete Series + Movies [Dual Audio]/Example [Dual Audio DVD 480p]/(Hi10)_Example_-_015_(DVD_480p)_(a-S)_(6852D8ED).mkv
I was only able to get the expected output after manually inserting wildcards (not regex) and file names suggested from this post, but this obviously means that I have to edit this script manually every time I want to use it for a new folder without auto-complete. I have a LOT of stuff to categorize, so that is simply not possible.