Ubuntu :: Bash Script - Randomize The Order Of The Songs Within The Folders Too?
Jun 24, 2010
Quote:
#!/bin/bash
#Licence: GPL v3 or (at your option) any later as published by FSF.
# add as much as wanted; include the dot before the extension
FORMATS=( .mp3 .wav .ogg )
[Code]...
it works great, however, as it is now, it only seems to work if it was in the very folder (or in nautilus-scripts and I right clicked it from the very folder) it was looking for the music, such as in ~/Music, and then what it did was read all of the subfolders on the first tier in there, and then all the subfolders in those for music.
I figured out that by adding, cd ~/Music, it enables it to be right clicked anywhere and opens music only from the ~/Music folder it can be used. However, one thing that's odd is if the subfolder in ~/Music folder has a 'space' in it's title, (ie, ~/Music/Green Day), it would fail. This is not the case for subfolders of the first tier subfolders in ~/Music though, (ie, ~/Music/Jazz/Simply Red). Is there a way to randomize the order of the songs within the folders too?
I'd like to create a script which allows me to order its data (let's say: Name, age, department and work start date) by date. And display the result in another file.
only does lines in text files, but I'd like something similar to sort .mp3 files in a directory, prior to burning them onto a DVD. How do I do that? Kurt
I am trying to write a bash script that will extract a .cbr (.rar) file, traverse the extracted files in alphabetical order and rename them 001.JPG, 002.JPG, 003.JPG, etc.So far I only have this much to extract it:
Im using posfix as a outgoing mail server, here i want to distribute the mails to different ips to avoid the ip blacklisting. I found a solution by using multiple transports , but here one thing blocking me was i could not able to select a transport using regexp or pcre matching pattern, log says that
Code: Jun 5 07:12:49 server postfix/trivial-rewrite[6079]: warning: pcre map /etc/postfix/transport.pcre, line 1: regular expression substitution is not allowed: skipping this rule
Is there any other short/easier and smarter way to do the following in Linux? code...
I need to use crontab to create folders every day and every month inside /home/abcd/dammi, /home/abcd/harrami, /home/wxyz/dammi and /home/wxyz/harrami. Can anyone help me with this?
tab-completion indexes system folders (like /usr/bin, /usr/local/bin)! so say i'm in a folder that has two files, 'text' and 'myprog', i type in an 'm' then tab, and i get hundreds of results including 'mysql', 'mysqlconfig', and others as im sure you can imagine. is there a way to set it to default or something else that will only make it index the current folder?
i tried changing my PATH variable so i could execute programs in the current directory without './' - what i added to PATH was ':.' at the end (apparently this is not the way to do it... :S). i tried resetting PATH various times ('unset PATH', 'PATH=$whatever...') but this has not fixed the problem. using 'unset PATH', of course, removes everything from PATH, which meant that functions (like 'ls') in /usr/bin and /usr/local/bin can't be found. obviously i want those to be found, but i would rather not tab through them!
I've been using fedora for quite some time now but I've never really written any bash scripts so I'm new to this. Basically what I'm trying to do is create symbolic links of movies that I have organized in this fashion:
Code: Movies/A Movies/B Movies/C etc.
I basically want to create an "ALL" folder that has links to all the movies in their designated folders. I have created somewhat of a bash script but it does not work.
Code: #!/bin/bash cd '/media/Videos/Movies' for file_name in `ls *` do ln -s "$file_name" All/$file_name done
I don't think its creating the right link to the movies and it is not taking into account the fact that some of the movies have spaces in their names.
Any script to categorize folders with similar name into one directory. For example: There are 4 directories named LinuxFedora, LinuxUbuntu, WindowsXP and Windows7. The script should be able to create two folder named Linux and Windows wheree respective directories are moved.
Next example: If there are many folder as below: DevLys 010 DevLys 010
I am administrating a lab in a university and every semester we need to delete all the home folders of the accounts for the next semester. I would like to make a bash script that does this automatically and having trouble with it. Note that I am writing my very first bash script. What I need to do is make a script to delete the following:
Delete everything in /home/$exp$num/$dir when "exp" could be either "rt", "ic" or "sp". "num" could run from 1(single digit) to 45 and dir is "profile" and "work".
This is what I tried to write:
Code:
#!/bin/sh cd /home for exp in "rt ic sp" do
[code]....
What seems to be the problem is the reading of "$exp$num" as a joint expression.
I am looking for a script/advice or guidance on how to write a script so that when I use the 'del' command it removes/sends the files/folders to a I specify for example 'dustbin
I have a shared NTFS partition ("shared") that I use for data for both Windows and Ubuntu. How can I mount the music folder on shared to $Home/Music, and the Videos folder on shared to $Home/Videos? I want to mount the different folders on the partition to different folders in home.
I am setting up a lubuntu nas with all of my music, movies, etc on it. I want to give my kids access to my mp3 directory, so I can move all of the kid appropiate music into the root of my mp3 dir, in the same order I have all of my music sorted. Under the Music folder, I have them sorted, in folders, by letter. So A, B, C, D, etc... Now, in those folders are the respective artists. So where there may be something approipate in the P folder (say, Paramore), there is something inapproipate (say, Pantera)Now, when the kids go to the P folder, I don't want them to even see the Pantera folder. I just want them to see the Paramore folder. I tried a test using chmod 711 and chmod 700 on a directory with a test user, and the user can't access the directory, but can still see it
The Problem was I wanted to open my /home/Pictures folder and have it display the contents of the My Pictures folder in my windows partition. This way I could have ubuntu and xp using the same set of music files, picture files, etc. I was having a very hard time understanding how to get from here to there because I'm such a newbie. However I have discovered how to do it and I wanted to post it, in hopes it will make things easier for other newbies.This allows me to see every TYPE of document in /dev/sda8/Media (windows My Documents folder) without having to see any of the folders (My Music, My Pictures, etc).
I've just today received my copy of Ubuntu 10.04, and I have to say so far I'm loving it a whole lot more than Ubuntu 9.10. However I am having one problem with managing my iPhone 3G. The device shows up in Rhythmbox, but I am unable to add music to the iPhone library.
I'm using the iPhone 3.1.3 firmware, so I know that's not an issue. Has anyone got any idea as to how to solve this?
Is there any apps for Ubuntu that can play a song at a slower speed yet keep the tone (like windows media player)? For instance I want to play a song at half speed so I can learn the guitar part... I have done this with windows.
iPhone 3G; Ubuntu 11.04; tried Banshee, Rythmbox, and Amarok. It looks like the songs went on my iPhone when I look at Rythmbox or Banshee under Devices. However, when I go to to the iPhone, I cannot see the songs under iTunes. Nothing is there
is there a way of playing songs that are available in the internet using totem music player, or any other application. for example, this link http://fizy.com/s/1ai91v refers to a song that is present on a web page. i want to play it on a music player, and many other songs also. my aim is to create a playlist of songs that are available on the internet. so i can listen to those songs whenever i am online.
what is a smart way of doing it.? i dont mean downloading, because those songs cant be downloaded but can only be listened.
For some reason, Rhythmbox will show itself playing a song (the notification in the top right corner) but I hear no sound. I can go to the application itself and see the play slider moving. I can't pause it or anything. if it's a bug in Rhythmbox itself. If I browse to the directory, and right click > Open with Rhythmbox, it works perfectly (although I still can't pause it)
Also, if I jump to another song, and then play the song it was playing silently, it works. Not sure why it does this.
I doubt it's the files themselves because I've been downloading all my songs from one site, and never had an issue in iTunes on a windows PC. It only does this to about 3 songs out of 164. It used to do this to only 2, but now it's doing it to 3 since the past few days when adding more songs.
I ripped 2 music CDs for a total of 78 minutes, but K3b won't burn them to a blank CD-R. It says the free space in temporary folder is 615.5 MB, but the size of project is 691.5 MB. I don't know why the tmp directory is that small when I have 615 GB free on my filesystem. When I start the burn, it simply says copying, but nothing shows up in the progress bars. I am able to burn direct copies of CDs, however. After a couple of tries and a couple of successful burns of entire CDs, I tried again, and it crashed.
I wanted to try gapless playback on Rhythmbox, but I can't find the "crossfade between songs" option anywhere. See here for comparison: [URL] and mine: [URL] where is this option gone?!