RSS/Atom feed Twitter
Site is read-only, email is disabled

Problem running script-fu in bash script

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

Problem running script-fu in bash script Mathieu Masse 09 Jun 04:16
  Problem running script-fu in bash script Sven Neumann 09 Jun 12:58
   Problem running script-fu in bash script Simon Budig 09 Jun 13:42
   Problem running script-fu in bash script Mathieu Masse 09 Jun 13:57
Mathieu Masse
2004-06-09 04:16:04 UTC (almost 20 years ago)

Problem running script-fu in bash script

Hi list,

This is my first posting to the list, I've run into a small problem while writing a script to simplify some task. My script does the following: opens up a .jpg file, crops it, adds text to it, flattens the layers, and saves everything back. All this runs fine in Gimp (ie. from the Xtra menu and script-fu)

Now when I call this from a bash script it is also fine, my problem is that instead of passing fixed parameters to my script-fu script I want to pass bash variables, but I can't get this to work, I looked on the web and tried what people suggest but can't get it to work, please help.

Here is some info on everything: Red Hat 9.0
Gimp-1.2.3-16 (from Red Hat's rpm)

Here is my bash script:

***************** #!/bin/sh
file=temp.jpg
fullpath=/home/mathieu/miscellaneous/backgrounds/weather_maps/temp.jpg current_time="13:25"
gimp -d -i --verbose -b '(script-fu-add-text-weather-map '$fullpath' '$file' '$current_time')'
*****************

Has you can see my gimp script as 3 parameters, which I want to pass as variables (fullpath, file, current_time).

TIA for the help

Mathieu

-- Mathieu Massé

Email: mathieu_masse@sympatico.ca

GPG Public Key available at http://www.keyserver.net Key fingerprint = 9C3F 7217 1AF5 0BC6 B502 79B3 B1BB 7360 D043 B69C

Sven Neumann
2004-06-09 12:58:02 UTC (almost 20 years ago)

Problem running script-fu in bash script

Hi,

Mathieu Masse writes:

Now when I call this from a bash script it is also fine, my problem is that instead of passing fixed parameters to my script-fu script I want to pass bash variables, but I can't get this to work, I looked on the web and tried what people suggest but can't get it to work, please help.

I'd say your quoting is wrong. You can hardly expect nested single ticks to work.

gimp -d -i --verbose -b '(script-fu-add-text-weather-map '$fullpath' '$file' '$current_time')'

Try this instead:

gimp -d -i --verbose -b '(script-fu-add-text-weather-map "$fullpath" "$file" "$current_time")'

Sven

Simon Budig
2004-06-09 13:42:12 UTC (almost 20 years ago)

Problem running script-fu in bash script

Sven Neumann (sven@gimp.org) wrote:

I'd say your quoting is wrong. You can hardly expect nested single ticks to work.

gimp -d -i --verbose -b '(script-fu-add-text-weather-map '$fullpath' '$file' '$current_time')'

Try this instead:

gimp -d -i --verbose -b '(script-fu-add-text-weather-map "$fullpath" "$file" "$current_time")'

Single ticks in this case prevent the variables to be expanded.

Try this instead:

gimp -d -i --verbose -b "(script-fu-add-text-weather-map \"$fullpath\" \"$file\" \"$current_time\")"

Bye, Simon

Mathieu Masse
2004-06-09 13:57:34 UTC (almost 20 years ago)

Problem running script-fu in bash script

On Wed, 2004-06-09 at 06:58, Sven Neumann wrote:

Hi,

Mathieu Masse writes:

Now when I call this from a bash script it is also fine, my problem is that instead of passing fixed parameters to my script-fu script I want to pass bash variables, but I can't get this to work, I looked on the web and tried what people suggest but can't get it to work, please help.

I'd say your quoting is wrong. You can hardly expect nested single ticks to work.

gimp -d -i --verbose -b '(script-fu-add-text-weather-map '$fullpath' '$file' '$current_time')'

Try this instead:

gimp -d -i --verbose -b '(script-fu-add-text-weather-map "$fullpath" "$file" "$current_time")'

That also does not work using the double quotes gimp thinks these are strings and does not evaluate the values of the variables...

Sven

--
Mathieu Massé

Email: mathieu_masse@sympatico.ca

GPG Public Key available at http://www.keyserver.net Key fingerprint = 9C3F 7217 1AF5 0BC6 B502 79B3 B1BB 7360 D043 B69C