From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1F3Gfv-0001dn-Hy for garchives@archives.gentoo.org; Sun, 29 Jan 2006 17:49:19 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id k0THmGLK013977; Sun, 29 Jan 2006 17:48:16 GMT Received: from bullet.espersunited.com (adsl-64-149-52-102.dsl.tul2ok.sbcglobal.net [64.149.52.102]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id k0THgtsM003458 for ; Sun, 29 Jan 2006 17:42:55 GMT Received: from camille.espersunited.com ([192.168.1.1]) by bullet.espersunited.com (8.13.4/8.13.4) with ESMTP id k0THgs7v008293 for ; Sun, 29 Jan 2006 11:42:54 -0600 Subject: [gentoo-user] OT - Question about new bash From: Michael Sullivan To: gentoo-user Content-Type: text/plain Date: Sun, 29 Jan 2006 11:43:12 -0600 Message-Id: <1138556593.10508.27.camel@camille.espersunited.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.4.2.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: d38dc4ae-9c12-4891-852d-a708331fef16 X-Archives-Hash: 1622f548eb86ae048b41f841dc4fd465 I wrote a script a long time ago for resizing pictures uploaded to a certain directory on my server box. The script was supposed to check to see if any JPG files in the directory had not been resized, and if they hadn't, it was supposed to resize them. It did some other stuff, but that was the important thing. It worked fine until the recent bash upgrade and now it gives me an error. Here is the script: michael@bullet ~ $ cat system/resizepics #!/bin/bash OLD_DIR=$PWD cd /home/michael/unfiledPics if [ ! -d current ]; then mkdir -p current/mini fi if [ ! `ls -l | wc -l` -le 2 ]; then for x in *.JPG; do if [ ! -e current/$x ]; then convert "$x" -thumbnail 200x200 -verbose current/mini/mini-"$x" convert "$x" -thumbnail 640x480 -verbose current/"$x"; fi done fi if [ `ls -l | wc -l` -ge 12 ]; then today=`date '+%m%d%y'` mv current $today mv $today /home/michael/webspace/html/camera mkdir -p /home/michael/unfiledPics/current/mini rm /home/michael/unfiledPics/*.JPG fi cd $OLD_DIR As I said, before the bash upgrade this worked perfectly. Now, when I try to run it, I get this: michael@bullet ~ $ system/resizepics system/resizepics: line 11: [: too many arguments system/resizepics: line 11: [: too many arguments The error is printed twice because there are two .JPG being checked, but I'm not sure why the error is occurring in the first place. Line 11 says: if [ ! -e current/$x ]; then This used to mean "if a file named "current/" does not exist, then execute the following block", but it keeps tripping on this line. Was the -e switch deprecated or something? What should it be? If it matters, my /bin/bash version is michael@bullet ~ $ bash --version GNU bash, version 3.00.16(1)-release (i586-pc-linux-gnu) Copyright (C) 2004 Free Software Foundation, Inc. Please help! -- gentoo-user@gentoo.org mailing list