OS X 脚本与 Shell 脚本游戏实用指南
1. iTunes 音乐库列表脚本
在 OS X 系统中,有一个实用的脚本 ituneslist ,它可以简洁且美观地列出你的 iTunes 音乐库,适合与他人分享,也可用于同步不同电脑和笔记本上的 iTunes 音乐库。
1.1 脚本代码
#!/bin/bash
# ituneslist--Lists your iTunes library in a succinct and attractive
# manner, suitable for sharing with others, or for synchronizing
# (with diff) iTunes libraries on different computers and laptops
itunehome="$HOME/Music/iTunes"
ituneconfig="$itunehome/iTunes Music Library.xml"
musiclib="/$(grep '>Music Folder<' "$ituneconfig" | cut -d/ -f5- | \
cut -d\< -f1 | sed 's/%20/ /g')"
echo "Your library is at $musiclib"
if [ ! -d "$musiclib" ] ; then
echo "$0: Confused: Music library $musiclib isn't a directory?" >&2
exit
超级会员免费看
订阅专栏 解锁全文
1002

被折叠的 条评论
为什么被折叠?



