bash 转换为C代码,并编译为可执行文件

[root@localhost ~]# wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9.tgz
[root@localhost ~]# tar xvfz shc-3.8.9.tgz
[root@localhost ~]# cd shc-3.8.9 [root@localhost shc-3.8.9]# gcc -c shc.c
[root@localhost shc-3.8.9]# gcc -o shc shc.o
[root@localhost shc-3.8.9]# cp -a shc /bin/ [root@localhost ~]# shc -r -T -f wang.sh
[root@localhost ~]# gcc -c wang.sh.x.c
[root@localhost ~]# gcc -o wang wang.sh.x.o

将python代码转换为C代码

[root@localhost ~]# yum install -y epel-release
[root@localhost ~]# yum install -y python-pip
[root@localhost ~]# yum install -y python-dev*
[root@localhost ~]# pip install cython [root@localhost ~]# vim lyshark.py [root@localhost ~]# cython lyshark.py --embed
[root@localhost ~]# gcc `python-config --cflags` `python-config --ldflags` lyshark.c -o lyshark

C语言调用shell命令,并返回结果

#include <stdio.h>

int main()
{
FILE * fp;
char buffer[1024];
fp=popen("free -h |grep 'Mem:' |awk '{print $2}'","r");
fgets(buffer,sizeof(buffer),fp);
printf("%s",buffer);
pclose(fp); return 0;
}

#include "stdafx.h"
#include <Windows.h> int _tmain(int argc, _TCHAR* argv[])
{
char psBuffer[128]; FILE *pPipe; char * wang; pPipe = _popen("dir", "rt");
fgets(psBuffer, 128, pPipe); printf("%s",psBuffer); feof(pPipe); system("pause"); return 0;
}

bash 转换为C代码的更多相关文章

  1. Linux - 标准输入转换为标准输出 代码(C)

    标准输入转换为标准输出 代码(C) 本文地址:http://blog.csdn.net/caroline_wendy Linux能够使用getc()和putc(),读取和写入每个输入字符. 代码: / ...

  2. 使用p4c将P4 14代码转换为16代码

    参考: [Question] How to make conversion between P4 14 and P4 16? 使用p4c将P4 14代码转换为16代码: $ p4test --p4v ...

  3. 编程算法 - 把字符串转换为整数 代码(C)

    把字符串转换为整数 代码(C) 本文地址: http://blog.csdn.net/caroline_wendy 题目: 写一个函数StrToInt, 模拟atoi的功能, 把字符串转换为整数. 须 ...

  4. 将Winform和wpf的界面转换为CPF代码用来实现跨平台

    CPF的设计器里带界面代码转换功能,将运行中的Winform或者wpf的程序界面转换为cpf代码,主要转换控件类型和布局,默认支持的是常用的原生控件.不支持Netcore,只支持.Netframewo ...

  5. 1.3 selenium IDE录制脚本转换为其他代码格式

    1.在seleniumIDE录制框中点击Options->options... 在Enable experimental features前打对勾,点击确定.

  6. 使用Git Bash上传代码到新的分支

    1.进入想要提交的项目,点击鼠标右键,选择"Git Bash Here" 2.输入命令,查看当前所有分支 git branch -a 3.输入命令,新建分支 git checkou ...

  7. 如何把设计图自动转换为iOS代码? 在线等,挺急的!

    这是一篇可能略显枯燥的技术深度讨论与实践文章.如何把设计图自动转换为对应的iOS代码?作为一个 iOS开发爱好者,这是我很感兴趣的一个话题.最近也确实有了些许灵感,也确实取得了一点小成果,和大家分享一 ...

  8. 把调试好的SQL语句转换为JAVA代码小工具

    关键点:Pattern实现SQL拆解.ZeroClipboard.js实现复制到剪切板 主要代码: <%@ page language="java" import=" ...

  9. swig模板 html代码自然状态下输出是转义的,必须加一个函数来转换为html代码;

    <div>{{o.content|raw}}</div> |raw 相当于一个函数,转义函数,最终输出结果为html代码:

随机推荐

  1. 微信小程序_(案例)简单中国天气网首页

    Demo:简单中国天气网首页 Page({ data:{ name:"CynicalGary", temp:"4", low:"-1°C", ...

  2. 识别C++编译器编译标准

    cout << __cplusplus<<endl; C++03:__cplusplus = 199711L C++11:__cplusplus = 201103L

  3. Java微信服务号的开发(简单入门)

    进行微信服务号开发的步骤 一个别人已经搭建好的项目参考地址:下载链接 1.搭建微信服务号的服务器 项目配置maven <dependency> <groupId>com.soe ...

  4. echarts热力地图

    <!DOCTYPE HTML> <html lang="en" xmlns:th="http://www.w3.org/1999/xhtml" ...

  5. LeetCode 238. 除自身以外数组的乘积( Product of Array Except Self)

    题目描述 给定长度为 n 的整数数组 nums,其中 n > 1,返回输出数组 output ,其中 output[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积. 示例: 输 ...

  6. LeetCode 82. 删除排序链表中的重复元素 II(Remove Duplicates from Sorted List II)

    题目描述 给定一个排序链表,删除所有含有重复数字的节点,只保留原始链表中 没有重复出现 的数字. 示例 1: 输入: 1->2->3->3->4->4->5 输出: ...

  7. smarty逻辑运算符

    smarty逻辑运算符 eq        equal : 相等 neq       not equal:不等于 gt        greater than:大于 lt        less th ...

  8. ASP.NET Core-Docs:在 ASP.NET Core 中启用跨域请求(CORS)

    ylbtech-ASP.NET Core-Docs:在 ASP.NET Core 中启用跨域请求(CORS) 1.返回顶部   2.返回顶部   3.返回顶部   4.返回顶部   5.返回顶部 1. ...

  9. GitHub:Facebook

    ylbtech-GitHub:Facebook 1.返回顶部   2.返回顶部   3.返回顶部   4.返回顶部   5.返回顶部 1. https://github.com/facebook 2. ...

  10. 设置placeholder 颜色

    ::-webkit-input-placeholder { /* WebKit browsers */ color: rgb(100, 193, 173); } :-moz-placeholder { ...