Shell script help needed

Jarl Stefansson jarl.stefansson-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Sun Sep 4 05:05:04 UTC 2011


I personally like to use find for this sort of thing because you can
do recursive work and get rid of all the pesky whitespace issues and
such, here something i think should work (I have not tested it), only
difference is the output filename.

find . -type f -iname '*.tiff' -exec convert {}  -colorspace Gray output_{} \;

Jarl


On Sat, Sep 3, 2011 at 11:17 PM, Lennart Sorensen
<lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org> wrote:
> On Sat, Sep 03, 2011 at 09:51:54PM -0400, Ted wrote:
>> On 09/03/2011 09:36 PM, phiscock-g851W1bGYuGnS0EtXVNi6w at public.gmane.org wrote:
>> >Folks -
>> >
>> >I have a mass of files with names like crw_0858.tiff that I need to
>> >convert to black an white using the following command line.
>> >
>> >convert crw_0858.tiff -colorspace Gray output_0858.tiff
>> >convert crw_0859.tiff -colorspace Gray output_0859.tiff
>> >
>> >etc
>> >
>> >This is beyond my shell-scripting capabilities. Can anyone suggest a
>> >simple shell script that can do this?
>> >
>> >Error checking is not required since I'm the only one to run this thing,
>> >and I do it manually.
>> >
>> >Thanks in advance...
>> >
>> >Peter
>> >
>> ls *.tiff | xargs -i convert {} -colorspace Gray output_{}.tiff
>>
>> but your get tiff.tiff at end of each file, odd, but not illegal,
>> doesn't seem like you care about
>> output name except that it has the numeric number still in it.
>
> Why not
> ls *.tiff | xargs -i convert {} -colorspace Gray output_{}
> then and avoid .tiff.tiff?
>
> --
> Len Sorensen
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>



-- 
Regards,

Jarl Stefansson
jarl.stefansson-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
+1-647-869-6908
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list