2011-09-27 09:52:04 +00:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
|
|
|
webroot=$HOME/Sites/webroot
|
|
|
|
print $webroot
|
|
|
|
print -- "Clean content's blog"
|
|
|
|
for fic in $webroot/content/html/??/blog/*(N); do
|
|
|
|
print "[d] $fic"
|
2012-01-16 21:02:35 +00:00
|
|
|
\rm -rf $fic
|
2011-09-27 09:52:04 +00:00
|
|
|
done
|
|
|
|
print -- "Clean multi/blog"
|
2012-01-17 10:02:10 +00:00
|
|
|
if [[ $(uname) = Linux ]]; then
|
2012-10-10 09:11:48 +00:00
|
|
|
column=9
|
2012-01-17 10:02:10 +00:00
|
|
|
else
|
|
|
|
column=9
|
|
|
|
fi
|
|
|
|
list=$(ls -lt -- $webroot/multi/blog | awk '{print $'$column'}')
|
|
|
|
nb=$(( $( print -l $list | wc -l ) - 5 ))
|
|
|
|
((nb<0)) && exit 0
|
2012-01-16 21:02:35 +00:00
|
|
|
res=( $( print -- $list | tail -n -$nb ) )
|
|
|
|
for fic in $res; do
|
2011-09-27 09:52:04 +00:00
|
|
|
print "[d] $fic"
|
2012-01-16 21:02:35 +00:00
|
|
|
\rm -rf $webroot/multi/blog/$fic
|
2011-09-27 09:52:04 +00:00
|
|
|
done
|
|
|
|
|