打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
running unix commands from c

Running UNIX Commands from C

We can run commands from a C program just as if they were from the UNIX command line by using the system() function. NOTE: this can save us a lot of time and hassle as we can run other (proven) programs, scripts etc. to do set tasks.

int system(char *string) - where string can be the name of a unix utility, an executable shell script or a user program. System returns the exit status of the shell.

Example: Call ls from a program

system is a call that is made up of 3 other commands: execl(), wait() and fork()


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
What is the difference between shell, console, and terminal?
UNIX Performance Management
PowerShell因为在此系统中禁止执行脚本的解决方法
Chapter 1. UNIX System Overview
Zabbix安全:破解弱口令后执行命令,获取shell
查看shell (bash)相关帮助
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服