分页: 1 / 1

find命令有办法管道吗?比如 cd >find /etc/*.conf

发表于 : 2009-03-27 14:41
winnaruto
我可以这么整
echo adfasdf>a.txt,此时adfasdf就写入到了a.txt里面了;
但是echo 123>a.txt就不行了,会报错,我发觉echo后面不能有数字,为什么,应该怎么整?

受到上面的启发,我想能不能cd >find /etc/*.conf,直接到达所在目录,结果不行,是哪里弄错了,还是find根本就不能这么用?

Re: find命令有办法管道吗?比如 cd >find /etc/*.conf

发表于 : 2009-03-27 14:55
eexpress
数字,你空格下啊。别和>连。那是特殊用途了。
比如
2>/dev/nul
是把警告信息去掉。

Re: find命令有办法管道吗?比如 cd >find /etc/*.conf

发表于 : 2009-03-27 16:39
懒蜗牛Gentoo
建议楼主去看看shell编程的书,基本上,只有你想不到,没有shell做不到。

Re: find命令有办法管道吗?比如 cd >find /etc/*.conf

发表于 : 2009-03-27 19:04
zhangsan5421
不知道有什么好关于shell编程的书籍。可以推荐下吗?如果网上有关于shell的暑假就好了。

Re: find命令有办法管道吗?比如 cd >find /etc/*.conf

发表于 : 2009-03-27 21:23
BigSnake.NET
cd >find /etc/*.conf

首先 lz 没搞清 > 是啥意思
其次 find 出来的不是目录, 不能 cd

Re: find命令有办法管道吗?比如 cd >find /etc/*.conf

发表于 : 2009-03-28 9:31
winnaruto
BigSnake.NET 写了:cd >find /etc/*.conf

首先 lz 没搞清 > 是啥意思
其次 find 出来的不是目录, 不能 cd
find出来的是字符串吧,有办法达到我要的效果吗?谢谢!!

Re: find命令有办法管道吗?比如 cd >find /etc/*.conf

发表于 : 2009-03-28 9:40
poet
winnaruto 写了:
BigSnake.NET 写了:cd >find /etc/*.conf

首先 lz 没搞清 > 是啥意思
其次 find 出来的不是目录, 不能 cd
find出来的是字符串吧,有办法达到我要的效果吗?谢谢!!
cd `find xxx`