Re: [SLUG] Bash Script

From: Eben King (eben1@tampabay.rr.com)
Date: Sun May 29 2005 - 11:45:15 EDT


On Sun, 29 May 2005, Bob Stia wrote:

> On Saturday 28 May 2005 23:07, Eben King wrote:
>
> > > > 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".
> > >
> > > 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
> >
> > Did it acttually print "Â" (A+Circumflex, 0xC2, compose ^ A), or is
> > that meant to be something else?
>
> No ! nothing like that in the outgoing message to the list.

OK, your mailreader is inserting 0xC2 as some sort of escape character. Now
that you've quoted them, each A+Circumflex has turned into A+Circumflex ^B
A+Circumflex.

Looks like you're using KMail 1.8. Can you use a different mailreader, or
put the output in your web space?

> > Dunno. It would be quite helpful if you bundled up the script and a
> > log of what you did, and what response you got (no retyping, as that
> > can introduce errors), put it on your web space, and posted the URL.
> > Make changes to the script if you want, but include a new copy of the
> > script then.

> Dunno either. Can't believe you got lines that I did not send. I hope
> the direct command that I copied from the console comes through
> properly this time. Let me know and if necessary I will upload it to
> the webpage.

I like the "file has CR-LF where it should have LF" hypothesis.

> > PS: "/" is a slash, "\" is a backslash. Linux uses a slash to
> > indicate directory levels.
>
> OK, was pretty sure I knew that. Kind of basic. Your use of the slash
> kind of confused me in whether I was supposed to use it or not in the
> command.

No prob. Sorry to be unclear.

> If I need to put it up on the web page I will do so. Not sure that will be
> productive or not. This SHOULD be simple. Just convert a batch of photo
> sizes to be used in COMPOSING a page.

How about something like:

for file in "$@" ; do
  djpeg < "$file" | pnmscale -xsize 640 | cjpeg -o > "${file%jpg}processed.jpg
done

No error-checking, width=640 fixed, suffix="jpg", format=JPEG, but other
than that...

Those things can be changed, at the expense of complexity.

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar
LIBRA:  A big promotion is just around the corner for someone
much more talented than you.  Laughter is the very best medicine,
remember that when your appendix bursts next week.  -- Weird Al

----------------------------------------------------------------------- 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:25:16 EDT