linux shell 重定向和多管道功能,该怎么解决

linux shell 重定向和多管道功能
我在做课程设计,要实现一个简单shell,linux系统下。我这是第一次接触linux,对于这个功能不了解,求能形象的解释一下。急计,明天要验收的!!!


------解决方案--------------------
《Unix环境高级编程》里面有实现类似linux shell命令,如ls之类的,可以参考.
------解决方案--------------------
实现类似ls命令
C/C++ code

#include "apue.h"
#include <dirent.h>

int
main(int argc, char *argv[])
{
    DIR                *dp;
    struct dirent    *dirp;

    if (argc != 2)
        err_quit("usage: ls directory_name");

    if ((dp = opendir(argv[1])) == NULL)
        err_sys("can't open %s", argv[1]);
    while ((dirp = readdir(dp)) != NULL)
        printf("%s\n", dirp->d_name);

    closedir(dp);
    exit(0);
}