Created
September 6, 2013 07:24
-
-
Save shim0mura/6460586 to your computer and use it in GitHub Desktop.
jpmobile使った時にfp用とsp用のテンプレートを作成するやつ
This file contains 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/bash | |
EX=".html.erb" | |
SP="_smart_phone" | |
FP="_mobile" | |
for dir in `ls`; do | |
if [ -d $dir ]; then | |
for file in `ls $dir`; do | |
if [ `echo $file | egrep '\.html\.erb$'` ]; then | |
primaryname=`echo $file | cut -d'.' -f 1` | |
cp ${dir}/$file ${dir}/${primaryname}${SP}${EX} | |
cp ${dir}/$file ${dir}/${primaryname}${FP}${EX} | |
fi | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment