How to make gmic as if it was a installed application under Ubuntu?

Recently, I compiled gmic under Ubuntu within my Android phone, however if I do gmic blah, then it says command not found. I would like for it to be found. I have to go into the folder gmic was built and do ./gmic to run it.

This is on my android phone:

root@localhost:~/gmic-3.5.5/src# ./gmic e \${rep_int2roman\\ 345\}
[gmic]./ Start G'MIC interpreter (v.3.5.5).
CCCXLV
[gmic]./ End G'MIC interpreter.

You have to copy the gmic executable file in /usr/bin/

Thank you, it works. Now the other question, as I am using bash, how exactly do I ensure that my code snip work here?

If you don’t want to enter the \{nightmare\} you should do:

gmic run ' stuff to run '

Actually, I do want to enter that nightmare because this code snip is not working out:

gmic run ' f=\{"const\ A=6;A<<2"\}

I kind of wish that it is possible to do what python does when you do this:

python

And you can write all the python code you want.

Will test on my laptop.
But you’re missing a quote at the end, and you can remove the backslashes since you’re using run.

Doesn’t work for me either.
I get:

[gmic]./run/__run/ Set local variable 'f={const'.
[gmic]./run/__run/ Set local variable 'A=6;A<<2}'.

Best i can do for now since i don’t know what it’s suppose to output:

gmic run ' f=\"{const\ A=6;A<<2\}\" e $f'
[gmic]./ Start G'MIC interpreter (v.3.5.6).
[gmic]./run/__run/ Set local variable 'f={const A=6;A<<2}'.
{const A=6;A<<2}
[gmic]./ End G'MIC interpreter.

You can also write your code in a file with nano, than call the file with gmic. I often just do that.

That’s a good idea, but gotta say I don’t like the idea of text editing in a shell, you know? I’ll figure that out when I fear this less. Alternatively, would love to run this as a local server so that I can adjust file on a GUI.

Nano is rather easy to use, it’s not vi.
You should just try it.
I mean, you can use gmic so you shouldn’t fear editing files in your terminal😅

1 Like

I’ll try it. On a side note, I’d like to see ord() and vord() escaping ' chars does not work. I don’t know how to use gmic on bash yet just because of that.

root@localhost:~# gmic '{_\'9\'}'
>
>
> ^C
root@localhost:~# gmic '\{\_\'9\'\}'
>
>
>
>

See what I mean?

Also, @prawnsushi I realized it doesn’t look bad. I however have to type manually to fill in what I’d like, which is fine in android phone. All it is for night and outside home test anyway. The only workaround is Wireboard for me.

Must be something to do with the Bash rules on Android-Ubuntu. Figure that out, then you are good. Have you tried the double backticks that you asked about in the other thread? I have seen a combination of double backticks and double quotes somewhere before…

Probably i was drunk yesterday or just not awakened enough:


gmic run ' f="{const\ "A=6;A<<2"}" e $f'
[gmic]./ Start G'MIC interpreter (v.3.5.6).
[gmic]./run/__run/ Set local variable 'f=24'.
24
[gmic]./ End G'MIC interpreter.

gmic \'{_\'9\'}\'
[gmic]./ Start G'MIC interpreter (v.3.5.6).
[gmic]./ Input file ''57'' at position 0
[gmic]./ *** Error *** Unknown command or filename ''57''; did you mean 'w5'?