用shell编写脚本,调用当前目录下可执行文件setdest,其中setdest的调用格式为:[code]./setdest -v <1> -n
by suanmeilizhi - Shell - 2012-05-06 00:35:33 阅读(9246) 回复(19)
我现在有一个用C语言编译出来的可执行文件file,如果在命令行中运行它需要输入3个参数,就像./file 768 512 n(说明一下,这个n是一个我希望在脚本中成为一个循环数,例如从1到500这样的),现在我希望在一个脚本中执行这个file,同时将其结果重定向到result的文件当中。各位兄弟姐妹们,帮帮忙,想想怎么写该脚本。 PS;该file文件执行中会发生segment fault和illigal instruction的错误,如果当n到了某个值的时候甚至会进行缓冲区...
写了一个SCRIPT, 名字test 内容如下 echo "Please input the filename(0 to exit):" while true do read key .... done 发现用 sh test运行很正常,但把test改成可执行属性后运行 ./test, 就有下面错误信息: Unknown OStype. Please contact your SA. sessxssc FileToDiff=: Command not found. FirstVersion=: Command not found. SecondVersion=: Command not found. Please input the filename(0 to exit): while: Expres...
或者是其他形式的可执行文件,只要无法查看程序内容就行. 但是,如果你仅仅是看不见内容就行了的话,不妨用 gzexe a.sh 原来的 a.sh 就被存为 a.sh~,新的 a.sh 是乱码,但是可以用 sh 的方式运行。 一、 如果在 C 程序用 system() 来运行,就一点意义都没有了, 因为 system 就是就是又开了一个shell进程,然后其内容也是shell -c "" 中的参数。你可以在命令行中测试: system("ls -l") 就相当于 sh -c 'ls -l' 这应该能够...
本帖最后由 pywj777 于 2013-05-21 10:59 编辑 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/34050/showart_274904.html
$a.out a.out: executable (RISC System/6000) or object module not stripped (什么意思) $file /bin/ls /bin/ls: executable (RISC System/6000) or object module 怎样做可以让C生成的可执行文件可以跟shell命令作用一样