当前位置: 动力学知识库 > 问答 > 编程问答 >

Terminal command "convert" not found in C program

问题描述:

i'm trying to use the convert terminal command in a C program using system function, this is the code piece

\#include <stdlib.h>

...

system("cd /Users/myUser/Desktop/photos/pgm;for i in *.jpg; do convert $i

-compress none -scale 32x24! $i.pgm; done;")

But I cant run the convert command, this is the program output:

sh: convert: command not found

I can run the same command in Terminal without problems

网友答案:

Check the full path to convert using which convert. Then exchange the full path in your C program.

分享给朋友:
您可能感兴趣的文章:
随机阅读: