fortuneteller
在c语言中如何调用bash命令。在bash中怎样调用c和perl
在c语言脚本中如何调用bash命令?希望能举几个例子。在bash中怎样调用一段c和perl命令
fortuneteller
[quote]原帖由 [i]cjaizss[/i] 于 2008-7-1 16:54 发表 [url=http://bbs.chinaunix.net/redirect.php?goto=findpost&pid=8712643&ptid=1185834][img]http://bbs.chinaunix.net/images/common/back.gif[/img][/url]
C语言脚本?........
system("/bin/bash -c ......");
命令还有C的命令? [/quote]
我概念不清,表述不准,您能读懂就行,呵呵。能不能举个具体例子我执行下试试/bin/bash -c 其中的"-c 表示c语言马 必须加马“
寂寞烈火
[quote]原帖由 [i]fortuneteller[/i] 于 2008-7-1 18:22 发表 [url=http://bbs.chinaunix.net/redirect.php?goto=findpost&pid=8713450&ptid=1185834][img]http://bbs.chinaunix.net/images/common/back.gif[/img][/url]
我概念不清,表述不准,您能读懂就行,呵呵。能不能举个具体例子我执行下试试/bin/bash -c 其中的"-c 表示c语言马 必须加马“ [/quote]
man bash
[quote]-c string If the -c option is present, then commands are read from
string. If there are arguments after the string, they are
assigned to the positional parameters, starting with $0.
[/quote]