????linux??????????????????????????????????????????????????????????dev?????????????????????????????????linux???豸????windows???У??豸?????????????????????????????????????????????linux???棬???ж??????????Щ?豸??????????????????????????????????linux???????????????????????????????????com??prt????????????????д??????????豸?????????д??????? ?????д?洢?????????????????豸?????????????????豸?????豸??α?豸??
????????豸????
??????????豸
????????豸??????????????1????????豸????Щ?豸??????????楨????????????????????????????豸??????????????????????????????? ????豸????????????????????????????豸?????д??????????????磬?????????豸?????????????????????????“cnblogs”???????????????????????????????????????????????????????????????????????????????????c??????s??
???????豸
???????豸????????????????????????豸????Щ?豸??????????????豸????????CD-ROM?????????
???????豸???????????????????????????????????????????????????????洢?????????????????豸????????????д???????????????????????е?????????洢???????????С??????汻????????????????????????????????????????????檔????????豸???????????????????洢????????????????????洢??
????α?豸
????????Unix???????У??豸?????????????????豸?????????????????豸??α?豸??????????????????????????????????????????α?豸?????? null??zero??full??loop??random??urandom
?????????????豸?????
????????????????豸????????????????????linux shell???????棬????????????????????????ó???????Щ?豸??????
????/dev/stdin
????/dev/stdout
????/dev/stderr
????/dev/null
????/dev/zero
????/dev/full
????/dev/random??urandom
????/dev/fd
????/dev/tcp|upd
????/dev/loop
????1?????????????豸
????????????????linux?????????????£?linux shell??????????????????????????????????? ??????????????????????????????fd0??fd1??fd2 ??stdin??stdout??stderr)
?????磺
[chengmo@centos5 shell]$ cat>teststdin</dev/stdin
test
#ctrl+D
#cat??/dev/stdin?????????????????????????teststdin???
[chengmo@centos5 shell]$ cat teststdin
test
[chengmo@centos5 shell]$ cat>teststdin
test
#ctrl+D
#?????????????????豸??/dev/stdinn
????/dev/stdin?????????豸
[chengmo@centos5 shell]$ cat test.sh >/dev/stdout |grep 'echo'
echo "very good!";
echo "good!";
echo "pass!";
echo "no pass!"
#/dev/stdout??????????????????????????????????????????fd1)
[chengmo@centos5 shell]$ cat test.sh  |grep 'echo'
echo "very good!";
echo "good!";
echo "pass!";
echo "no pass!";
[chengmo@centos5 shell]$ cat test.sh >/dev/stderr |grep 'echo'
#!/bin/sh
scores=40;
if [[ $scores -gt 90 ]]; then
echo "very good!";
elif [[ $scores -gt 80 ]]; then
echo "good!";
elif [[ $scores -gt 60 ]]; then
echo "pass!";
else
echo "no pass!";
fi;
#/dev/stderr ????????????????????????????棬??????????????????????????grep????????????????