Linux.com

Re: CLI Magic: For geek cred, try these one-liners

Posted by: Anonymous [ip: 195.135.221.2] on July 24, 2008 12:47 PM
In times when you have systems with several cores, you might want to use make for this task. This could work as follows (not tested, just written):
# cat Makefile
.SUFFIXES:
.SUFFIXES: .gif .jpg

JPGS=$(wildcard *.jpg)
GIFS=$(subst jpg,gif,$(JPGS))

default: $(GIFS)

.jpg.gif:
convert -verbose -colors 8 $< $@

then:
make -j <number of CPUs>
(note that there must be a tabulator before the convert line in order to make this work)

#

Return to CLI Magic: For geek cred, try these one-liners