linux下写C程序,执行shell文件
2015-10-09 10:00
726 查看
1、变成c文件
vi xuan.c
#include <stdlib.h>
main()
{
system("sh /home/gbase/xuanxx/scripts/xuan.sh");
}
2、生成执行文件
gcc -o xuan xuan.c
3、运行执行文件
./xuan
4、生成linux命令
vi .bashrc
alias xuan='/home/gbase/xuan'
source .bashrc
直接在linux系统运行xuan即可执行xuan.sh脚本
vi xuan.c
#include <stdlib.h>
main()
{
system("sh /home/gbase/xuanxx/scripts/xuan.sh");
}
2、生成执行文件
gcc -o xuan xuan.c
3、运行执行文件
./xuan
4、生成linux命令
vi .bashrc
alias xuan='/home/gbase/xuan'
source .bashrc
直接在linux系统运行xuan即可执行xuan.sh脚本
相关文章推荐
- linux下写C程序,执行shell文件
- linux下写C程序,执行shell文件
- linux下写C程序,执行shell文件
- linux下写C程序,执行shell文件
- linux下写C程序,执行shell文件
- shell中pushd和popd
- Shell中的IFS解惑
- shell中各种括号的作用()、(())、[]、[[]]、{}
- shell概念
- 在perl中,同时获取shell脚本返回值和标准输出。
- Java实现远程联接服务器执行shell命令
- shell中的括号(小括号,中括号,大括号)
- 推荐一款shell自定义提示符Sexy Solarized Bash Prompt
- IOS 通过脚本自动打包工具 webfrogs/xcode_shell
- Shell数组相关操作
- LINUX下使用Shell自动监控tomcat并且执行重启操作
- /etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc区别
- 【.bash_profile 与 .bashrc 的区别】
- 栈——PowerShell版
- 什么是shell