#!/bin/csh

foreach y (2018)
  foreach d ($y/??????)
    set n = `ls -1 $d/*.ps | wc -l`
    if( $n != 0 )then
      foreach ps ($d/*.ps)
        set b = `basename $ps .ps`
        set dir = `dirname $ps`
        convert -rotate 90 $ps ${dir}/${b}.jpg
     endif
  end
end
