tag:blogger.com,1999:blog-6845625574553920830.post6833541959413571667..comments2024-03-24T14:29:11.536-07:00Comments on Filthy Pants: A Computer Blog: Bash Scripts for RetroArchHunter K.http://www.blogger.com/profile/18379090454291486194noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-6845625574553920830.post-85403105640873358382017-05-16T06:10:22.275-07:002017-05-16T06:10:22.275-07:00@Unknown
hey, thanks! I updated the post with your...@Unknown<br />hey, thanks! I updated the post with your version :)Hunter K.https://www.blogger.com/profile/18379090454291486194noreply@blogger.comtag:blogger.com,1999:blog-6845625574553920830.post-88915973281031139662017-05-16T05:16:48.971-07:002017-05-16T05:16:48.971-07:00The second script above has some issues. First if...The second script above has some issues. First if the file names have spaces in them this will fail. Second, it always simply appended to an existing playlist so there could be dups if you scanned again to the same file. Here is an edit with these issues solved:<br /><br />#!/bin/bash<br /><br />COUNTER=1<br />SAVEIFS=$IFS<br />IFS=$'\n'<br /><br />if [ -f $3 ]<br /> then<br /> rm $3<br />fi<br /><br />for I in $2/*<br /> do<br /> echo "${I}" >> $3<br /> echo ${I} | sed 's/\.[^.]*$//' | sed 's/.*\///' >> $3<br /> echo "$1" >> $3<br /> echo "$1" | sed 's/\.[^.]*$//' | sed 's/.*\///' >> $3<br /> echo "$COUNTER|crc" >> $3<br /> echo "DETECT" >> $3<br /> COUNTER=$[$COUNTER +1]<br /> done<br /><br />IFS=$SAVEIFS<br /><br />Hope this helps.Unknownhttps://www.blogger.com/profile/05345942382380480309noreply@blogger.com