http://blog.csdn.net/cheyo/article/details/6595955

 #include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/types.h> int main()
{
pid_t status; status = system("./test.sh");
if (- == status)
{
printf("system error!");
}
else
{
printf("exit status value = [0x%x]\n", status);
if (WIFEXITED(status))
{
if ( == WEXITSTATUS(status))
{
printf("run shell script successfully.\n");
}
else
{
printf("run shell script fail, script exit code: %d\n", WEXITSTATUS(status));
}
}
else
{
printf("exit status = [%d]\n", WEXITSTATUS(status));
}
} return ;
} status

Linux System命令的更多相关文章

  1. linux awk命令详解,使用system来内嵌系统命令, awk合并两列

    linux awk命令详解 简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分 ...

  2. Linux常用命令(一)

    Linux常用命令 1. pwd查看当前路径(Print Working Directory)    [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...

  3. Linux下命令行安装weblogic10.3.6

    Linux下命令行安装weblogic10.3.6 一.安装前准备工作: 1.创建用户useradd weblogic;创建用户成功linux系统会自动创建一个和用户名相同的分组,并将该用户分到改组中 ...

  4. linux 基础命令与文件管理

      Linux终端介绍 Shell提示符 Bash Shell基本语法 基本命令的使用:ls.pwd.cd 查看系统和BIOS硬件时间 Linux如何获得帮助 Linux关机命令:shutdow.in ...

  5. linux管道命令grep命令参数及用法详解---附使用案例|grep

    功能说明:查找文件里符合条件的字符串. 语 法:grep [-abcEFGhHilLnqrsvVwxy][-A<显示列数>][-B<显示列数>][-C<显示列数>] ...

  6. linux cat 命令详解

    linux cat 命令详解 http://linux.chinaunix.net/techdoc/system/2007/11/16/972467.shtml adb shell su //这个不一 ...

  7. Linux常用命令集合

    常用的Linux命令,备忘 1 pwd 显示当前目录 命令格式: pwd [选项] 2 cd 更换目录 命令格式: cd [目录名] 例: 3 ls 显示当前目录内容 命令格式: ls [选项] [目 ...

  8. linux top命令中各cpu占用率含义

    linux top命令中各cpu占用率含义 [尊重原创文章摘自:http://www.iteye.com/topic/1137848]0.3% us 用户空间占用CPU百分比 1.0% sy 内核空间 ...

  9. Linux netstat命令详解

    Linux netstat命令详解 一  简介 Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多 ...

随机推荐

  1. elasticsearch配置文件

    配置Elasticsearch的集群名称,默认是elasticsearch,Elasticsearch会自动发现在同一网段下的Elasticsearch 节点,如果在同一网段下有多个集群,就可以用这个 ...

  2. 解决:Map的area属性标签鼠标Hover可以给area加背景

    css的area标签是不支持hover的,只有a标签才支持.li标签在IE浏览器下才支持,所以采用jquery的mouseenter和mouseleave事件完成.首先讲jQuery对应的事件:1.m ...

  3. 新手git遇到的问题

    1. 如何撤销git add,不小心执行了git add . 操作,但是又不能提交所有的文件,因为对应不同的分支,现在怎么样可以将git add 撤销回来? 解决:git reset HEAD(暂时尝 ...

  4. 无法启动此程序,因为计算机中丢失api-ms-win-crt-runtime-l1-1-0.dll已解决

    问题 : 无法启动此程序,因为计算机中丢失api-ms-win-crt-runtime-l1-1-0.dll 解决 1, 首先把C:\Windows\SysWOW64\的api-ms-win-crt- ...

  5. 跳一跳外挂的python实现--OpenCV步步精深

    去我的个人网站看看吧 http://opencvblog.com/跳一跳外挂-python实现/ 都在这里啦

  6. nginx基础内容

    1.配置文件结构图 2.作用1:静态文件服务器 http { server { listen ; location / { root /data/www; } location /images/ { ...

  7. web项目中使用的协议

    DNS协议 1.DNS协议的作用是将域名解析为IP,网络上的每个站点的位置是用IP来确定的,访问一个网站首先就要知道它的IP,不过数据组成的IP记起来不方便,所以就使用域名来代替IP,由于IP和域名的 ...

  8. XSS攻击原理

    本文转载的地址:http://www.2cto.com/Article/201209/156182.html Xss(cross-site scripting)攻击指的是攻击者往Web页面里插入恶意h ...

  9. lvs负载均衡连接

    http://blog.csdn.net/zwz1984/article/details/45194377 http://blog.csdn.net/zwz1984/article/details/4 ...

  10. LeetCode第九题—— Palindrome Number(判断回文数)

    题目描述 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same ...