cat >b <<EOF line1 line2 line3 EOF # 方法1 while read line do echo ${line} done < <(cat b) # 方法2 cat b|while read line do echo ${line} done # 方法3 while read line do echo ${line} done < b…
原文地址 stackexchange:What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? (原文wiki链接在翻译中替换为百度百科链接.) A terminal is at the end of an electric wire, a shell is the home of a turtle, tty is a strange abbreviation and a con…
popen, pclose - pipe stream to or from a process FILE *popen( const char *command, const char *type); int pclose(FILE *stream); 描述 The popen() function opens a process by creating a pipe, forking, and invoking the shell. Since a pipe is by definitio…