![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Check if parameter passes in contains certain string | bcunney | Shell Programming and Scripting | 9 | 08-15-2008 10:54 AM |
| what's wrong with my bash script? | ikk | Shell Programming and Scripting | 4 | 02-22-2008 12:55 AM |
| Connecting to Oracle from Shell..What Am I doing Wrong | dzyr4tt | Shell Programming and Scripting | 1 | 12-21-2006 01:05 AM |
| new to shell scripting: whats wrong with my if loop | stride6 | Shell Programming and Scripting | 10 | 07-20-2006 11:18 AM |
| Wrong Shell Invoking My Script On Linux | kowrip | Shell Programming and Scripting | 3 | 09-10-2003 11:18 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Bash passes flags to shell wrong
Hi, first post, so hello to all.
I have a Bash scripting problem that is driving me a bit nutty. It involves a program called 'convert' which is part of the ImageMagick collection. Normal usage from the commandline is: $ convert -resize 120x120 inputfile.jpg outputfile.jpg This is working just fine (from the command line) However while inside a shellscript everything seems to go weird, this I beleive should work... echo converting thumbnails for searchfile in ./*.jpg do echo processing echo $searchfile convert ‐resize 120x120 "$searchfile" "$tndir/$searchfile" done but I get instead convert: Unable to open file (‐resize) [No such file or directory]. convert: Unable to open file (120x120) [No such file or directory]. I have tried strong quotes to bind the arguments tighter convert '‐resize 120x120' "$searchfile" "$tndir/$searchfile" I have tried opening it in a subshell (convert ‐resize 120x120 "$searchfile" "$tndir/$searchfile") But nothing will convince it that -resize 120x120 is an argument not a file!!! The file arguments themselves are fine $searchdir and $tndir are interpreted right. Indeed I get unaltered files dumped in the destination directory which kind of confirms that its just the -resize flag that isn't getting heard. I have read the man for this program over many times and I'm sure i'm using it correctly. Any ideas on how to crack this? Many thanks to any takers. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|