Re: [SLUG] Bash script

From: Eben King (eben1@tampabay.rr.com)
Date: Thu May 19 2005 - 23:59:47 EDT


On Thu, 19 May 2005, Bob Stia wrote:

> What is wrong with this script??
> --------------------------------------------------
> #!/bin/sh
...
> cd $FROM_DIR
> for i in *.$FROM; do
>
>   echo $1

What is $1 (yeah the first argument, but what in this case)? DYM $i?

>   if [ ! -e "$TO_DIR/$i"  ]       # Process only files not already done 

I would use [[ ... ]] but that may be just me.

...
> ----------------------------------------------------------------------
> This is what I get:
>
> /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
> /home/bob/commands/ImageMagickConvert: line 38:  : command not found
> /home/bob/commands/ImageMagickConvert: line 39:  : command not found
> /home/bob/commands/ImageMagickConvert: line 40:  : command not found
> /home/bob/commands/ImageMagickConvert: line 41:  : command not found

I would bracket the "convert" line with a "set -x"/"set +x" pair to see
what's being executed.

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar
TAURUS:  You will never find true happiness - what you gonna
do, cry about it?  The stars predict tomorrow you'll wake up,
do a bunch of stuff and then go back to sleep.  -- 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:02:10 EDT