Created
September 24, 2014 10:47
-
-
Save syui/d902365e0ab80d90f48b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
dir=$HOME/Music | |
cha=`cat $dir/info.txt | grep FILE | tail -n 1 | cut -d '/' -f 6` | |
# cha=`cat $dir/info.txt | grep FILE | tail -n 1 | xargs basename` | |
sum=`echo $cha | wc -c | tr -d ' '` | |
fil=$dir/info.s | |
if [ -e $fil ]; then | |
i=`cat $fil | tail -n 1` | |
if [ $i -le $sum ]; then | |
a=`expr $i + 4` | |
b=$i"-"$a | |
c=`cat $dir/info.txt | grep FILE | tail -n 1 | cut -d '/' -f 6 | cut -b $b | tr -d '\n'` > /dev/null | |
echo -ne "$c" | |
echo $a >> $fil | |
else | |
c=`cat $dir/info.txt | grep FILE | tail -n 1 | cut -d '/' -f 6 | cut -b 1-4 | tr -d '\n'` > /dev/null | |
echo -ne "$c" | |
rm $fil | |
fi | |
else | |
c=`cat $dir/info.txt | grep FILE | tail -n 1 | cut -d '/' -f 6 | cut -b 1-4 | tr -d '\n'` > /dev/null | |
echo -ne "$c" | |
echo 1 > $fil | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment