就是我提问的那句话啊!我把它直接写死在脚本里面,只有这一句,涉及的目录我都先建立好了的。错误提示也是上面我贴的那段话。(./move.sh: ./0040775000101100010130000000000010002113131010147: No such file or directory)。
昨天有事没上来结贴,抱歉。现在结了,如果chaisave有什么新发现的话给我消息吧。
再次感谢!
my op is linux
my tar is :
tar (GNU tar) 1.13.19
Copyright 2001 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.
真的是非常感谢chaisave的细心帮助,我也试了一下你写的,也不行,痛苦,但直接运行是可以的啊。哎!下午结贴。
我刚才直接在bash下试了一下,可以用了。昨天我是把这句写在shell脚本里面的,就不能用,报错(./move.sh: ./0040775000101100010130000000000010002113131010147: No such file or directory)。chaisave你试一下了,谢谢啦!^-^
OK,我想你最好man tar先,下面使我的机机(Debian sid-- a GNU/Linux)的部分输出:
-f, --file [HOSTNAME:]F
use archive file or device F (default "-", meaning stdin/stdout)
“tar c .”在我的机器上其实是可以压缩当前目录的(default "-"),
若加上“f -”,即“tar cf - .”也行,“f -”说明了tar所操作的文件/设备是stdin/stdout,对于压缩就是stdout,对于解压就是stdin。
不知道你的机器上的tar是什么情况,这也是我让你看manual的原因。
it works under my system (Debian sid).
$cd /tmp;mkdir src dest
$cd src;cp ~/garbage* .;cd .. # fill it with some files to copy
$(cd src && tar cf - . ) | (cd dest && tar xvfp -)
$ls dest
garbage_blah garbage_blah1
Once again, please check your man page of tar, and make sure that your version of tar do support such options. BTW, what your OS is?