以前、「壬申の乱」という番組が消されてしまって、 Shift-JIS 問題だとは気が付いていたのだが、 修正する暇と気力がなくて放置していた。
[root@link /tmp]# sh /usr/local/sbin/RemoveList.sh
/mnt/share/壬垂フ乱_0430.mpg not found
DelPlKey{1146377940}
[START]DelPlKey
[FINISH]DelPlKey
へいはちさん修正版のスクリプトを参考に 自分なりに修正してみた。
[root@link sbin]# cat RemoveList.sh
#!/bin/sh
TMPFILE=/tmp/RemoveList.$$
/usr/local/PCast/DbAcRap GetPlListBottom > $TMPFILE
sed -n -e 's/^.*Index=\([0-9]*\)[ ]*FileName=\(.*\)/\1 \2/p' $TMPFILE | nkf -e |
while read Index FileName
do
if [ ! -f `echo $FileName | nkf -s` ]
then
echo $FileName not found
DataKey=`sed -n -e 's/^.*Index='$Index'[ ]*DataKey=\(.*\)/\1/p' $TMPFILE`
/usr/local/PCast/DbAcRap DelPlKey\{$DataKey\}
fi
done
rm $TMPFILE
「壬申の乱_0430.mpg」が存在する状態で実行する。
[root@link sbin]# ls /mnt/share/ | nkf -e : 壬申の乱_0430.mpg : [root@link sbin]# sh RemoveList.sh [root@link sbin]# ls /mnt/share/ | nkf -e : 壬申の乱_0430.mpg :誤削除されなかったことを確認
[root@link sbin]# rm -i /mnt/share/????????_0430.mpg
rm: `/mnt/share/\220p\220\\\202\314\227\220_0430.mpg' を削除しますか(yes/no)? y
[root@link sbin]# sh RemoveList.sh
/mnt/share/壬申の乱_0430.mpg not found
DelPlKey{1146408781}
[START]DelPlKey
[FINISH]DelPlKey
[root@link sbin]#
OK
へいはちさん、ありがとうございました。
|
← HS-DGL ファームウェア 1.52 正式版 |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ PSP |