ponysay/ponyquotes.sh
2012-08-19 06:08:10 +02:00

17 lines
364 B
Bash
Executable file

mkdir -p quotes
for ponies in $(cat ponyquotes/ponies); do
for pony in $(echo $ponies | sed -e 's/+/ /g'); do
echo 'Generating quote files for '"$pony"
for file in $(ls "ponyquotes/" | grep "$pony\\.*"); do
if [[ -f "ponyquotes/$file" ]]; then
cp "ponyquotes/"$file "quotes/"$ponies'.'$(echo $file | cut -d '.' -f 2)
fi
done
done
done