顯示具有 System Program 標籤的文章。 顯示所有文章
顯示具有 System Program 標籤的文章。 顯示所有文章

2013年4月19日 星期五

Shell 內建命令 (Shell Built-in Command)



Shell Built-in Command 是指與 shell code 寫在一起編譯成,屬於 shell 這個 program 本身功能的指令,在Windows中稱為 internal command,例如:cd, exit, umask, alias 等等,這種內建在 shell 程式碼內的功能無法在 shell 中使用 execv() 去呼叫外部程式的方式執行

<Shell.c>
int main()
{
    ...
     if( strcmp(cmd, "cd") == 0)
            cd(pathname);
    ...
}