예제 #1
0
파일: mysh.c 프로젝트: DanishKhan14/xv86Fun
int buildin(char * s){
    int rt = 0;
    //exit
    if(strcmp("exit",s) == 0){
        rt = 1;
        exit(0);
    }
    
    //hisotry
    if(strcmp("history",s) == 0){
        rt = 1;
        history();
    }
    
    //exclamation
    if (*s == '!') {
        rt = 1;
        int id  = 0;
        IDcounter--;
        if (IDcounter < 0) {
            IDcounter = 0;
        }
        
        if (*(s+1) == '\0') {
            id = IDcounter;
            char* redo = exclamation(id);
            buildin(redo);
        }
        else{
            id = atoi(s+1);
            char* redo = exclamation(id);
            buildin(redo);
        }
    }
    return rt;
    
}
예제 #2
0
파일: main.cpp 프로젝트: SeleniumHQ/buck
int main()
{
    exclamation();
    return 0;
}