ast_comparator/test/student_data/handout/shlab-handout/cases/reference_12_tsh.c
/* 
 * builtin_cmd - If the user has typed a built-in command then execute
 *    it immediately.  
 */
If the user has typed a built-in command then execute
it immediately.
If the user has typed a built - in command then execute it immediately .
int builtin_cmd(char **argv) 
{
    if (!strcmp(argv[0], "quit")) 
    {
        exit(0);
    }
    else if (!strcmp(argv[0], "jobs"))
    {
        listjobs(jobs);
        return 1;
    }
    else if (!strcmp(argv[0], "bg") || !(strcmp(argv[0], "fg"))) 
    {
        do_bgfg(argv);
        return 1;
    }
    else if (!strcmp("&", argv[0]))
    {
        return 1;
    }
    return 0;     
}
int builtin_cmd ( char * * argv ) { if ( ! strcmp ( argv [ 0 ] , " " ) ) { exit ( 0 ) ; } else if ( ! strcmp ( argv [ 0 ] , " " ) ) { listjobs ( jobs ) ; return 1 ; } else if ( ! strcmp ( argv [ 0 ] , " " ) || ! ( strcmp ( argv [ 0 ] , " " ) ) ) { do_bgfg ( argv ) ; return 1 ; } else if ( ! strcmp ( " " , argv [ 0 ] ) ) { return 1 ; } return 0 ; }
builtin_cmd - If the user has typed a built-in command then execute
    it immediately.
builtin_cmd - If the user has typed a built - in command then execute it immediately .
/* Here is the order of command processing
     * 1. Check if quit entered so it exit
     * 2. Check for jobs
     * 3. Check for fg/bg command
     */ // this is a built-in command for quit // this is a built-in command for job // this is a built-in command for foreground or background // it is contain "&" means your programme is running in background process so it is display background jobs // it returns 0 if either command or programme is none of these  /* not a builtin command */