Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
{} substitution #5667
{} substitution #5667
Comments
|
Post the command you are using and the output with |
|
Provide some examples (with --verbose output) of what are you trying to achieve for better understanding. |
|
sorry, I updated my original comment. |
That's because you are using double quotes and bash executes I will look at the rest of the issue, but since your command is quite complex I would recommend writing a script that accepts the filename as the first argument and call it with |
I will follow your recommendations. Could you elaborate on how/ when bash calls youtube-dl? I'm quite new to bash. I was wrapping the whole command in single quotes for defining an alias (that's how the escaping confusion began). |
youtube-dl takes the argument after Pedantic note: It actually calls
I thinks the current behaviour of using |
|
Thanks i have a working script now. |
When I download somefile.mp4 and convert it to somefile.mp3,
{}.descriptionwould be replaced by/full/path/somefile.mp3.descriptionwhere I want the/full/path/somefile.mp4.descriptionfile.I tried using
--exec "echo $(basename {} .mp3).mp4.description"to strip/add the extension (and the path) but it got interpreted asecho {}.description:Storing
{}in a variable naturally renders it being empty. I tried to use substitution and all sorts of escaped chars in a number of ways, but the problem seems to be that the{}string is being replaced with the converted (audio) file's full path when bash already tried to run its substitution routines.A solution for this would be to automatically rename description files to match the {} in
{}.descriptionwith{}. Please share your thoughts, I'd be interested to now if and how I'd be able to use substitution with{}.