Gimp-Forum.net
gimp script that does not work within shell script - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: gimp script that does not work within shell script (/Thread-gimp-script-that-does-not-work-within-shell-script)



gimp script that does not work within shell script - MVE - 10-08-2022

Hi folks!

I have a silly problem with gimp and linux bash.
I have a very simple gimp script that work well when called from a interactive shell.
I have a shell script that call the gimp script, so I have not typing all the gimp invocation.
The shell script call the gimp script: but gimp never exit and does not create files.
The same problem when I used "source" to execute the bash script directly in the interactive shell.
Have anyone a similar problem??

I send attached the two scripts and the output of the two forms of calling the gimp script, directly or with the bash script.

There are two differences: the message "batch command executed successfully" is show one or two times, and in the first case all work well and newfiles are generated, in the second I have to interrupt gimp (Ctrl-C) and no file is generated.

Any insight?
Thanks!
MVE

Gimp GNU versión 2.8.18
Linux 4.9.0-19-686-pae #1 SMP Debian 4.9.320-2 (2022-06-30) i686 GNU/Linux


RE: gimp script that does not work within shell script - MVE - 10-08-2022

I attach again forum.txt, because the first version is incomplete...[attachment=8815]

Bug fixed!
Using de shell invocation into a makefile, I realized that I had a lot of quotes...
In short:
* from the command line:
$    gimp --as-new -dfs -i -b '(img2img "ATSP-A0min.png" "prueba.eps")' -b '(gimp-quit 1)'
* from a Makefile:
%.eps: %.png
    gimp --as-new -dfs -i -b '(img2img "$<" "$@")' -b '(gimp-quit 0)'

* from a shell script:
    gimp --as-new -dfs -i -b '(img2img "'$1'" "'$2'")' -b '(gimp-quit 0)'

So this issue has to do with bash, not with gimp...

That's all, folks!