[X-Unix] Cron problem solved

Marley Graham mgraham at aquaflo.com
Mon Jun 27 11:26:53 PDT 2005


Thanks, Robert. I like the idea of simplifying the $( ls mg* ).

I thought about including the rm command immediately after the  
capture, but I was a little hesitant to do it until I have some  
history of success with the conversions. I just want to have the  
original captured screens until I know that I have the PDFs. I do  
like the succinctness of it though.

Marley Graham
Aqua-Flo Supply
==============

On Jun 27, 2005, at 12:49 AM, Robert Frank wrote:

> The $(...) actually starts a sub shell, then returns the result. In  
> the below fragment, you can simply write:
>
> for screen in mg*
> do
>   ...
> done
>
> provided you are in the directory with the screen shots when the  
> script starts, and file globbing is not turned off. There is no  
> need to run a subshell in order to get a list of files. The list is  
> automatically composed by simply using 'mg*'.
>
> And: you could of course immediately promote the files to pdf in  
> the capture script:
>
> cd /path/to/dir/with/screen/shots
> now=`/bin/date "+%H%M%S"` # note the two backtics!
>  /usr/sbin/screencapture mg$now
> /path/to/ps2pdf mg$now            # substitute the /path/to
> /bin/rm mg$now
>
>
> The next step is, of course, to archive these shots from time to  
> time (e.g. once a month), then to get rid of them when no longer  
> used (e.g. after one year).
>
> Robert
>
> On 25 Jun 2005, at 6:18, x-unix- 
> request at listserver.themacintoshguy.com wrote:
>
>
>> At the end of the day, I use ps2pdf to convert the files to pdf, so I
>> can view them as a series of screen shots in iMovie. I created the
>> following script which I run to do the conversion and remove the
>> original files:
>>
>> #!/bin/sh        #psconvert
>>
>> for screen in $(ls mg*)
>> do
>>          ps2pdf $screen
>> done
>> rm mg*[1-9]
>> exit
>>
>> which leaves a series of files like:
>>          mg103000.pdf
>>
>> So, thanks again for all of the suggestions. I hope the results will
>> be useful to someone.
>>
>>
>
> Departement Informatik   FGB   tel   +41 (0)61 267 14 66
> Universität Basel                          fax. +41 (0)61 267 14 61
> Robert Frank
> Klingelbergstrasse 50                 Robert.Frank at unibas.ch
> CH-4056 Basel
> Switzerland                                   http:// 
> www.informatik.unibas.ch/personen/frank_r.html
>
>
> _______________________________________________
> X-Unix mailing list
> X-Unix at listserver.themacintoshguy.com
> http://listserver.themacintoshguy.com/mailman/listinfo/x-unix
>
> Listmom is trying to clean out his closets! Vintage Mac and random  
> stuff:
>         http://search.ebay.com/_W0QQsassZmacguy1984
>



More information about the X-Unix mailing list