Sponsored Content
Top Forums Shell Programming and Scripting Help with Playlist creation script Post 302618289 by Davinator on Tuesday 3rd of April 2012 09:33:27 PM
Old 04-03-2012
Quote:
Originally Posted by chihung
put the original folder together with the dir name together and sort base on the 2nd field.

Code:
sep="|"
while read d
do
  # get rid of the trailing /
  dd=${d%/}

  # print the orginal and dirname, separated by a "|" (hopefully no "|" in the folder name
  echo "$d$sep${dd##*/}"
done < /mnt/user/Music/_Playlists/Rock.m3u | sort -t"$sep" -k 2 | cut -d"$sep" -f1

Thanks! I think this is almost what I need. I'm a little confused about what "while read d" does (I'm very much a bash noob who uses Google extensively to program). I'm hoping to add some lines to my code which will look for any m3u files in my $PlaylistDIR (the ones that my script just created - currently set to /mnt/user/Music/_Playlists/), and sort them all one by one using your code.

How would your code need to be altered for that to work?
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in a shell script to edit a tablespace creation script.

Hi, CREATE TABLESPACE aps_blob_large01 DATAFILE '/c2r6u13/u03/oradata/qnoldv01/aps_blob_large0101.dbf' SIZE X 270532608 REUSE DEFAULT STORAGE (INITIAL 134217728 NEXT... (2 Replies)
Discussion started by: rparavastu
2 Replies

2. UNIX for Dummies Questions & Answers

[solved] Script creation (how to include options in the script)

Hi guys i have written a script which takes the options given to him and execute itself accordingly. for example if a script name is doctortux then executing doctortux without option should made doctortux to be executed in automatic mode i.e. doctortux -a or if a doctortux is needed to run in... (4 Replies)
Discussion started by: pinga123
4 Replies

3. Shell Programming and Scripting

a playlist for ffmpeg streamer

Hi, I hope I am posting in the right place. I use to stream to justin tv using ffmpeg with that command ffmpeg -re -i "path/to/input.avi" -vcodec libx264 -preset fast -crf 30 -acodec libfaac -ab 128k -ar 44100 -f flv rtmp://live.justin.tv/app/xxxxxxxxxxx I would like to know if a bash... (2 Replies)
Discussion started by: undercash
2 Replies

4. Shell Programming and Scripting

Music Playlist parse/grep

Hi. Please help with a single line bash that will match field 3, and field 2 , if not then echo "Not Found". Original Music List name; Musiclists.m3u Format: \Music\The Rolling Stones - Angel.mp3 \Music\Maroon 5\Moves Like Jagger.mp3 Make a groomed playlist variable... $... (0 Replies)
Discussion started by: DSommers
0 Replies

5. What is on Your Mind?

Video Playlist for New Users with Under 5 Posts

Hi. I'm working on showing the video player to new users with under 5 posts which shows only videos like the ones below, which are related to the forums, how to use the forums, code tags, usercp, etc.: https://www.unix.com/members/1-albums215-picture1265.png or maybe something minimal and... (5 Replies)
Discussion started by: Neo
5 Replies
Jajuk(1)						      General Commands Manual							  Jajuk(1)

NAME
Jajuk - advanced jukebox and music organizer DESCRIPTION
Jajuk is software that organizes and plays music. Jajuk is designed to be intuitive, fast and provide multiple ways to perform the same operation. It is a fully-featured application geared towards advanced users with very large or scattered music collections. FEATURES
* Digital DJ: Let Jajuk make your programmation based on your own rules * Ambience management: ask for a soft playlist in two clicks maximum! * Configurable cross-fade * Recursive play/repeat/shuffle/push in directories/sub-directories or by genre/artist/ albums * Best Of smart function to play your favourite tracks * Novelties smart function to play your collection newest albums * Continue smart function to continue in current album after a shuffle selection * Push into player queue * Planned tracks: forsee your selection * Various startup modes: none, last one, last one keep position, specified, shuffle, novelties, bestof * Intro from a track position and specified length * Shuffle in entire collection * Repeat, shuffle, intro, fast forward/rewind, mute... HOMEPAGE
http://jajuk.info/index.php/Main_Page AUTHOR
This manual page was written by Varun Hiremath <varunhiremath@gmail.com>, for the Debian project (but may be used by others). December 7, 2006 Jajuk(1)
All times are GMT -4. The time now is 08:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy