{"id":248,"date":"2010-07-12T14:56:11","date_gmt":"2010-07-12T06:56:11","guid":{"rendered":"http:\/\/thislove.cz.cc\/?p=248"},"modified":"2011-01-29T22:07:56","modified_gmt":"2011-01-29T14:07:56","slug":"%e9%ad%85%e6%97%8fm3%e6%92%ad%e6%94%be%e5%88%97%e8%a1%a8%e5%88%b6%e4%bd%9c%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/study.5dimn.com\/?p=248","title":{"rendered":"\u9b45\u65cfM3\u64ad\u653e\u5217\u8868\u5236\u4f5c\u5de5\u5177"},"content":{"rendered":"<link type=\"text\/css\" rel=\"Stylesheet\" href=\"wp-content\/plugins\/syntax-highlighter-compress\/styles\/Styles\/shThemeDjango.css\"\/>\n\u535a\u5ba2\u91cc\u6ca1\u591a\u5c11\u6280\u672f\u6587\u7ae0\uff0c\u8d34\u4e0a\u6765\u5145\u5145\u6570\uff1a\uff09<\/p>\n<p>\u6ca1\u5b66\u8fc7bash\uff0c\u8fb9\u641c\u8d44\u6599\u8fb9\u8bf7\u6559\u522b\u4eba\u8fb9\u5199\uff0c\u5199\u4e86\u4e24\u5929\uff0cnnd\uff0c\u7d2f\u6b7b\u4e86\u3002<\/p>\n<pre class=\"brush:shell\">#!\/bin\/bash\n\nIFS='\n\n'\n\ndirscan()\n\n{\n\nls -1 \"$1\" | while read filename\n\ndo\n\n\tif [ -d \"$filename\" ]; then\n\n\t\tcd \"$filename\"\n\n\t\tdirscan `pwd`\n\n\t\tcd ..\n\n\telse\n\n\t\tpath=\"${PWD\/\/\\\/\/\\\\}\"\n\n\t\tpath=\"${path\/\/\\\\media\\\\MUSIC\\ CARD\/}\"\n\n\t\tlistname=$(basename \"`pwd`\").M3U\n\n\t\tpathnname=\"${savepath}\/${listname}\"\n\n\t\t[ ! -e $pathnname ] &amp;&amp; touch \"${pathnname}\"\n\n\t\textname=`echo \"$filename\" | awk -F. '{print $NF}'`\n\n\t\tif [ \"$extname\" == \"mp3\" -o \"$extname\" == \"wma\" -o \"$extname\" == \"ogg\" -o \"$extname\" == \"flac\" ]; then\n\n\t\t\techo -E \"#[UTF8FULLPATH]${path}\\\\${filename}\" &gt;&gt; \"$pathnname\"\n\n\t\tfi\n\n\tfi\n\ndone\n\n}\n\nsavepath=\"\/media\/MUSIC CARD\/PLAYLISTS\"\n\ncd \/media\/MUSIC\\ CARD\/MUSIC\n\ndirscan \"\/media\/MUSIC CARD\/MUSIC\"\n\nunset IFS\n\n###########################################################\n\n#\t\u6b64\u811a\u672c\u53ea\u7528\u4e8e\u5236\u4f5c\u9002\u5408\u9b45\u65cfM3\u4f7f\u7528\u7684\u64ad\u653e\u5217\u8868\n\n#\t\u5982\u4f5c\u5176\u4ed6\u7528\u9014\uff0c\u8bf7\u81ea\u884c\u4fee\u6539\u76f8\u5173\u53c2\u6570\n\n#\t\u64ad\u653e\u5217\u8868\u6837\u672c\u5982\u4e0b\uff1a\n\n#\t#[UTF8FULLPATH]\\MUSIC\\direct_name\\your_music.flac\n\n###########################################################\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u535a\u5ba2\u91cc\u6ca1\u591a\u5c11\u6280\u672f\u6587\u7ae0\uff0c\u8d34\u4e0a\u6765\u5145\u5145\u6570\uff1a\uff09 \u6ca1\u5b66\u8fc7bash\uff0c\u8fb9\u641c\u8d44\u6599\u8fb9\u8bf7\u6559\u522b\u4eba\u8fb9\u5199\uff0c\u5199\u4e86\u4e24\u5929\uff0cnnd\uff0c\u7d2f\u6b7b\u4e86\u3002 #!\/bin\/bash IFS=&#8217; &#8216; dirscan() { ls -1 &#8220;$1&#8221; | while read filename do if [ -d &#8220;$filename&#8221; ]; then cd &#8220;$filename&#8221; dirscan `pwd` cd .. else path=&#8221;${PWD\/\/\\\/\/\\\\}&#8221; path=&#8221;${path\/\/\\\\media\\\\MUSIC\\ CARD\/}&#8221; listname=$(basename &#8220;`pwd`&#8221;).M3U pathnname=&#8221;${savepath}\/${listname}&#8221; [ ! -e $pathnname ] &amp;&amp; touch &#8220;${pathnname}&#8221; extname=`echo &#8220;$filename&#8221; | awk -F. &#8216;{print $NF}&#8217;` if [ &#8220;$extname&#8221; == &#8220;mp3&#8221; -o &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/study.5dimn.com\/?p=248\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;\u9b45\u65cfM3\u64ad\u653e\u5217\u8868\u5236\u4f5c\u5de5\u5177&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-248","post","type-post","status-publish","format-standard","hentry","category-27","entry"],"_links":{"self":[{"href":"https:\/\/study.5dimn.com\/index.php?rest_route=\/wp\/v2\/posts\/248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/study.5dimn.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/study.5dimn.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/study.5dimn.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/study.5dimn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=248"}],"version-history":[{"count":1,"href":"https:\/\/study.5dimn.com\/index.php?rest_route=\/wp\/v2\/posts\/248\/revisions"}],"predecessor-version":[{"id":418,"href":"https:\/\/study.5dimn.com\/index.php?rest_route=\/wp\/v2\/posts\/248\/revisions\/418"}],"wp:attachment":[{"href":"https:\/\/study.5dimn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/study.5dimn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/study.5dimn.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}