+
Skip to content

ASUKA39/myshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

myshell

TODO:

  • man
  • ps: ps -e ps -ef ps -aux
  • tree: print tree structure still has some bugs
  • redirection
  • pipe
  • background

Useage

to compile project

make all

to remove compiled result

make clean

Development Template

function template:

#include "cmd_template.h"

int cmd_template(int argc, char *argv[]) {
    if (argc < n) {
        fprintf(stderr, "Usage: %s\n", argv[0]);
        return 1;
    }
    // TODO
    return 0;
}

header template:

#ifndef CMD_TEMPLATE_H_
#define CMD_TEMPLATE_H_

int cmd_template(int argc, char *argv[]);

#endif

add header to main.h:

#include "cmd_template.h"

register command in main.c/regist_func():

static HASH_NODE *regist_func(void) {
    // other commands
    hash_register(hash_table, "cmd_template", cmd_template);
    return NULL;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载