Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
That worked with the spaces. Some characters are still breaking, i.e., the single quote ' and the ampersand & broke quite a few track titles. Any suggestions on those?
I always change the names of files like that, even if it's only temp for processing in a *nix system.
Otherwise you're always having to fool around with every cmd... just too hard.
I use underscores instead of spaces, remove quotes. Ampersands I think are safe if surrounded by other (non-whitespace) chars.
I always change the names of files like that, even if it's only temp for processing in a *nix system.
Otherwise you're always having to fool around with every cmd... just too hard.
I use underscores instead of spaces, remove quotes. Ampersands I think are safe if surrounded by other (non-whitespace) chars.
If I had started my library like that it would be an option, but I have over 400 albums I've scanned into my library and really don't want to have to go back and fix everything. I did find a solution here, check this out:
Code:
#!/bin/bash
# set -x
#grep -v '#' 5_Star.m3u | tr -d '\r' |while read line ; do scp pi@192.168.1.2:/media/mypassport"'$line'" /home/andrew/temp/ ; done
grep -v '#' 5_Star.m3u | tr -d '\r' |while read line ; do scp pi@192.168.1.2:/media/mypassport"$(printf '%q' "$line")" /home/andrew/temp/music/ ; done
Not exactly sure why it works, but it did. I had only 1 album that didn't go through, and still not sure why, as there were no funky characters in the filename, but since it was only 1, I was able to copy that over manually.
Would there be a way to tell this script to skip a file if it already exists on the local computer, just to jazz it up and make this script so I could use it to update my local files?
It is fairly easy to script the name changes, and you only need to write that program once.
You can re-use it if/when you need it again.
(eg any time you bring in files from MSWin if you write it generically)
After running it, you'll never have to worry again for those (renamed) files.
It is fairly easy to script the name changes, and you only need to write that program once.
You can re-use it if/when you need it again.
(eg any time you bring in files from MSWin if you write it generically)
After running it, you'll never have to worry again for those (renamed) files.
I might check out a solution for renaming. As for the rsync solution, is there a maximum for the number of includes you can use with it? My one playlist has 455 songs in it, so if I was piping each filename to a single rsync command it would be a very large command! My music library is not everything just all jumbled in a single folder, it's all organised by artist/album title and then every song for that album is in that folder, even ones I don't really listen to. I wouldn't want to rsync those to my local pc.
personally, i can see the need for what qkzoo has scripted, and i would be against touching these filenames.
because new ones are added all the time (at least that's how it is with me), media servers rely on the names (and think there's new files if you rename them), the order of files (i.e. songs) is sometimes defined by those names etc...
since a usable workaround exists, i wouldn't touch the filenames.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.