Re: [SLUG] Bash Script

From: Bob Stia (rnr@sanctum.com)
Date: Sat May 28 2005 - 22:31:20 EDT


On Wednesday 25 May 2005 21:27, Eben King wrote:
> On Wed, 25 May 2005, Bob Stia wrote:
> > On Wednesday 25 May 2005 08:40, sean@hogston.com wrote:
> > > ok I have one last thing to try and then i'm out of suggestions.
> > > for the convert line change it to be /usr/bin/convert instead of
> > > just convert. I suggest this only because it is using /bin/sh and
> > > MAYBE when the script is running it does not find the convert
> > > command. I have noticed this in some of my scripts so I usually
> > > make it a habbit to either put the full path to the command or
> > > set it as a variable.
> >
> > OK, added /usr/bin/  in front of the convert line. Didn't help.
> > Still the same errors.  Thanks for trying to help. If you can think
> > of anything else I am all ears.
>
> Put "set -x"/"set +x" above and below the call to "convert" to see
> what it's _really_ calling, how it's being called, and when the
> errors occur.  Then, adjust your response depending on what it says.
> If it were not able to find "convert" (which adding "/usr/bin/" would
> fix) then the error would be something about "command not found".

Eben,

Please excuse my ignorance. Put the whole "set -x"/"set +x" above and
below the convert line or the "set -x" above and the /"set +x" below.
(minus the quotes ?? )  The backslash is confusing.

I put a set -x above and a set +x below and this is what i got:
----------------------------------------------------------------
Running /home/bob/commands/ImageMagickConvert

/home/bob/commands/ImageMagickConvert: line 34:  
: command not found
/home/bob/commands/ImageMagickConvert: line 35:  
: command not found
/home/bob/commands/ImageMagickConvert: line 36:  
: command not found
/home/bob/commands/ImageMagickConvert: line 37:  
: command not found
+ $'\302\240' $'\302\240' $'\302\240'
$'\302\240'                                                /usr/bin/convert
-quality 70 -geometry 800x600 /                                              
home/bob/WebPages/PorschePilots/fog/temp/p5150410                                               .jpg /home/bob/WebPages/PorschePilots/fog/carloue                                              
limages/p5150410.jpg
/home/bob/commands/ImageMagickConvert: line
39:                                                 : command not found
+ set $'+x\302\240' $'\302\240' $'\302\240' $'\30                                              
2\240'
/home/bob/commands/ImageMagickConvert: line 40: s                                              
et: +� invalid option
set: usage: set [--abefhkmnptuvxBCHP] [-o option]                                                
[arg ...]
bob@EasyStreet:~>
-----------------------------------------------------------

So then I went in and moved the larger files (two sizes) and moved them
to /temp/temp. Image p5150410 (noted above) was the first image of the
latger sizes. Then I ran the same command again and this is what I got:
------------------------------------------------------------------------------
Running /home/bob/commands/ImageMagickConvert

/home/bob/commands/ImageMagickConvert: line 34:  : command not found
/home/bob/commands/ImageMagickConvert: line 35:  : command not found
/home/bob/commands/ImageMagickConvert: line 36:  : command not found
/home/bob/commands/ImageMagickConvert: line 37:  : command not found
+ $'\302\240' $'\302\240' $'\302\240' $'\302\240' /usr/bin/convert
-quality 70 -geometry 800x600
'/home/bob/WebPages/PorschePilots/fog/temp/*.jpg'
'/home/bob/WebPages/PorschePilots/fog/carlouelimages/*.jpg'
/home/bob/commands/ImageMagickConvert: line 39:  : command not found
+ set $'+x\302\240' $'\302\240' $'\302\240' $'\302\240'
/home/bob/commands/ImageMagickConvert: line 40: set: +� invalid option
set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
bob@EasyStreet:~>
---------------------------------------------------------------------------------
(No mention of the specific photo)
Then I changed the "from directory in the script to temp/temp and ran
the command again. This is what I got:
----------------------------------------------------------------------------
bob@EasyStreet:~> /home/bob/commands/ImageMagickC
onvert
Running /home/bob/commands/ImageMagickConvert

/home/bob/commands/ImageMagickConvert: line 34:  
: command not found
/home/bob/commands/ImageMagickConvert: line 35:  
: command not found
/home/bob/commands/ImageMagickConvert: line 36:  
: command not found
/home/bob/commands/ImageMagickConvert: line 37:  
: command not found
+ $'\302\240' $'\302\240' $'\302\240'
$'\302\240'                                                /usr/bin/convert
-quality 70 -geometry 800x600 /                                              
home/bob/WebPages/PorschePilots/fog/temp/temp/p51                                              
50410.jpg /home/bob/WebPages/PorschePilots/fog/ca                                              
rlouelimages/p5150410.jpg
/home/bob/commands/ImageMagickConvert: line
39:                                                 : command not found
+ set $'+x\302\240' $'\302\240' $'\302\240' $'\30                                              
2\240'
/home/bob/commands/ImageMagickConvert: line 40: s                                              
et: +� invalid option
set: usage: set [--abefhkmnptuvxBCHP] [-o option]                                                
[arg ...]
bob@EasyStreet:~>
-----------------------------------------------------------------
(The specific photo, first in the series of larger photos, is mentioned
again. But otherwis the result look identical to me, except I don't
know what I am looking at)

Starting to get frustrating. Looks like I need to do these images one x
one in Gimp or Image Magick.

Bob S.

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:23:14 EDT