【发布时间】:2013-06-26 02:23:53
【问题描述】:
我遇到了一个问题。我想在 shell 命令中使用 C 变量 (dd)。
假设 abc.c 是我的 C 程序。
int main()
{
int block = 1313; /*any integer */
system("dd if=device of=output-file bs=4096 count=1 skip=$((block))");
return 0;
}
现在,如果我在 dd 命令中使用 1313 代替 block,那么它可以正常工作。但是当我写block 时,它会在输出文件中写入零,因为block 是一个C 程序变量并在shell 命令中使用。
【问题讨论】:
-
你没有用谷歌搜索过这个,对吧。而且你不知道 PHP 和 C 之间的区别,是吗?