From owner-freebsd-questions@FreeBSD.ORG Sat Nov 8 10:56:36 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CA6C1065672 for ; Sat, 8 Nov 2008 10:56:36 +0000 (UTC) (envelope-from jonathan+freebsd-questions@hst.org.za) Received: from hermes.hst.org.za (onix.hst.org.za [209.203.2.133]) by mx1.freebsd.org (Postfix) with ESMTP id 694C58FC0C for ; Sat, 8 Nov 2008 10:56:34 +0000 (UTC) (envelope-from jonathan+freebsd-questions@hst.org.za) Received: from [10.1.11.1] ([10.1.11.1]) (authenticated bits=0) by hermes.hst.org.za (8.13.8/8.13.8) with ESMTP id mA89xffF076770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 8 Nov 2008 11:59:42 +0200 (SAST) (envelope-from jonathan+freebsd-questions@hst.org.za) From: Jonathan McKeown To: freebsd-questions@freebsd.org Date: Sat, 8 Nov 2008 12:12:46 +0200 User-Agent: KMail/1.9.4 References: <49143663.9070804@shopzeus.com> <20081107201954.5d7e4993.freebsd@edvax.de> In-Reply-To: <20081107201954.5d7e4993.freebsd@edvax.de> X-Face: $@VrUx^RHy/}yu]jKf/<4T%/d|F+$j-Ol2"2J$q+%OK1]&/G_S9(=?iso-8859-1?q?HkaQ*=60!=3FYOK=3FY!=27M=60C=0A=09aP=5C9nVPF8Q=7DCilHH8l?= =?iso-8859-1?q?=3B=7E!42HK6=273lg4J=7Daz?=@1Dqqh:J]M^"YPn*2IWrZON$1+G?oX3@ =?iso-8859-1?q?k=230=0A=0954XDRg=3DYn=5FF-etwot4U=24b?=dTS{i X-Spam-Score: -4.399 () ALL_TRUSTED,BAYES_00 X-Scanned-By: MIMEDefang 2.61 on 209.203.2.133 Subject: Re: eps to jpg conversion - which program? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 10:56:36 -0000 On Friday 07 November 2008 21:19, Polytropon wrote: > On Fri, 07 Nov 2008 13:36:51 +0100, Laszlo Nagy wrote: > A batch solution is simple: > > #!/bin/sh > for f in *eps; do > convert ${f} `basename ${f} .eps`.jpg > done You can also save yourself repeated calls to basename by using for f in *eps; do convert ${f%.eps}.jpg done Look under parameter expansion in the manpage for sh(1) (or bash(1) if you have bash installed). As far as I can tell csh/tcsh doesn't support this useful feature. Essentially, a Bourne-type shell with parameter expansion expands ${variable#prefix} or ${variable%suffix} to $variable with the prefix or suffix, respectively, removed. Jonathan