资源简介
该程序是我写的博客“一起talk C栗子吧(第七十一回:C语言实例--DIY shell)”的配套程序,共享给大家使用
代码片段和文件信息
/* **************************
* The main funtion of shell
* *************************/
#include
#define BUF_SIZE 64
typedef struct _input_type
{
char * str; // the value of input
int size; // the length of value
}input_type;
input_type input[] =
{
{“exit“4}
{“cd“2}
{“ls“2}
};
void cds(const char * p);
void lss(const char * p);
int main(int argc char *argv[])
{
char buf[BUF_SIZE];
int res = 1;
int flag = 1;
int index = 0;
while(flag)
{
printf(“|->“);
if(NULL == fgets(bufBUF_SIZEstdin))
return 0;
index = sizeof(input)/sizeof(input_type);
while(ind
- 上一篇:VC++利用消息机制在两个EXE程序间通信
- 下一篇:C:DIY cd命令
相关资源
- 自动GetShell
- 模拟命令解释器MyShell的设计与实现
- Linux 用C语言实现shell
- 操作系统模拟Shell课程设计报告
- C语言实现:Linux下的myshell
- shell程序实验详解
- myshell:操作系统编程-自己用C语言写
- c语言实现linux shell下的cat命令
- Shell命令解释器项目源码+文档
- shell.rar,一个用c++实现的具有基本完
- Linux下Shell命令解释步骤程序实现
- 获取linux内核核心信息(shell脚本)
- shell实现(c语言)
- 汇编转为shellcode形式
- 直接插入排序、折半排序、shell排序、
- 7种常用排序算法实现C++冒泡排序、选
评论
共有 条评论