Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2080264
  • 博文数量: 470
  • 博客积分: 10206
  • 博客等级: 上将
  • 技术积分: 5620
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-03 12:50
文章分类

全部博文(470)

文章存档

2012年(1)

2011年(18)

2010年(47)

2009年(404)

分类: LINUX

2009-05-07 08:39:43

大家好:
linux:/home/kira # tar -cvf /home/kira/compress/df0902.tar /home/kira/compress/df02*.txt
tar: Removing leading `/' from member names
home/kira/compress/df0201.txt
home/kira/compress/df0202.txt
home/kira/compress/df0203.txt
home/kira/compress/df0204.txt
home/kira/compress/df0205.txt
home/kira/compress/df0206.txt
home/kira/compress/df0207.txt
home/kira/compress/df0208.txt
home/kira/compress/df0209.txt
home/kira/compress/df0210.txt
home/kira/compress/df0211.txt
home/kira/compress/df0212.txt
home/kira/compress/df0213.txt
home/kira/compress/df0214.txt
home/kira/compress/df0215.txt
home/kira/compress/df0216.txt
home/kira/compress/df0217.txt
home/kira/compress/df0218.txt
home/kira/compress/df0219.txt
home/kira/compress/df0220.txt
home/kira/compress/df0221.txt
home/kira/compress/df0222.txt
home/kira/compress/df0223.txt
home/kira/compress/df0224.txt
home/kira/compress/df0225.txt
home/kira/compress/df0226.txt
home/kira/compress/df0227.txt
home/kira/compress/df0228.txt
linux:/home/kira # echo "$?"
0
linux:/home/kira #



用 tar 压缩写全路径时,会报错,但是系统返回值是0,也就是命令执行成功了。

一直找不到问题还请高手帮帮忙。谢谢了。



您对本贴的看法:
| |

天使



CU编号: 347943
注册:2005-12-11
最后登录: 2009-05-07
帖子:
精华:0







状态:...在线...

[] [] [博客]


[] 顶部
发表于 2009-5-6 19:25 
linux下你用绝对路径打包时系统自动会把最前面那个/去掉,变成相对路径。
sco unix下则不会,这样生成的包如果解包时不看源包的路径,直接解包,容易造成数据损失。



您对本贴的看法:

__________________________________

shell新手&&awk新手
我的awk学习笔记
http://blog.chinaunix.net/u3/91453/showart_1798635.html
| |
(暗夜星空)
精灵使
休息休息



CU编号: 713644
注册:2008-6-3
最后登录: 2009-05-07
帖子:
精华:0







来自:广州<-->杭州
状态:...在线...

[] [] [博客]


[] 顶部
发表于 2009-5-6 19:49 
回复 #1 coco_andy 的帖子

你根据什么说压缩报错了?



您对本贴的看法:

__________________________________

有时候回答问题是信口开河......
因此不保证所有回复问题的答案的准确性.
如果正好是对的,那是碰到了死耗子..呵呵.
想着休息,不想做事!
| |

骑士




CU编号: 706735
注册:2008-5-18
最后登录: 2009-05-07
帖子:
精华:0







状态:...离线...

[] [] [博客]


[] 顶部
发表于 2009-5-6 23:37 
我是在输出错误日志时,发现的,但是echo "$?"的值为"0",一直想不明白。才来请教各位高手的
信息如下:
linux:/home/kira/compress # tar -cvf /home/kira/compress/df0902.tar /home/kira/compress/df02*.txt 2>error.log
home/kira/compress/df0201.txt
home/kira/compress/df0202.txt
home/kira/compress/df0203.txt
home/kira/compress/df0204.txt
home/kira/compress/df0205.txt
home/kira/compress/df0206.txt
home/kira/compress/df0207.txt
home/kira/compress/df0208.txt
home/kira/compress/df0209.txt
home/kira/compress/df0210.txt
home/kira/compress/df0211.txt
home/kira/compress/df0212.txt
home/kira/compress/df0213.txt
home/kira/compress/df0214.txt
home/kira/compress/df0215.txt
home/kira/compress/df0216.txt
home/kira/compress/df0217.txt
home/kira/compress/df0218.txt
home/kira/compress/df0219.txt
home/kira/compress/df0220.txt
home/kira/compress/df0221.txt
home/kira/compress/df0222.txt
home/kira/compress/df0223.txt
home/kira/compress/df0224.txt
home/kira/compress/df0225.txt
home/kira/compress/df0226.txt
home/kira/compress/df0227.txt
home/kira/compress/df0228.txt
linux:/home/kira/compress # cat error.log
tar: Removing leading `/' from member names



您对本贴的看法:
| |

精灵王
精灵王?



CU编号: 199500
注册:2004-11-15
最后登录: 2009-05-06
帖子:
精华:0







状态:...离线...

[] [] [博客]


[] 顶部
发表于 2009-5-7 01:24 
-P



您对本贴的看法:

__________________________________

正则 shell买什么书好?来这里混混,2个月速成班,还不收费!
| |
(暗夜星空)
精灵使
休息休息



CU编号: 713644
注册:2008-6-3
最后登录: 2009-05-07
帖子:
精华:0







来自:广州<-->杭州
状态:...在线...

[] [] [博客]


[] 顶部
发表于 2009-5-7 07:10 
回复 #4 coco_andy 的帖子

tar: Removing leading `/' from member names

这个不算是错误



您对本贴的看法:

__________________________________

有时候回答问题是信口开河......
因此不保证所有回复问题的答案的准确性.
如果正好是对的,那是碰到了死耗子..呵呵.
想着休息,不想做事!
| |

骑士




CU编号: 706735
注册:2008-5-18
最后登录: 2009-05-07
帖子:
精华:0







状态:...离线...

[] [] [博客]


[] 顶部
发表于 2009-5-7 08:11 
tar -Pcvf /home/kira/compress/df0902.tar /home/kira/compress/df02*.txt
home/kira/compress/df0201.txt
home/kira/compress/df0202.txt
home/kira/compress/df0203.txt
home/kira/compress/df0204.txt
home/kira/compress/df0205.txt
home/kira/compress/df0206.txt
home/kira/compress/df0207.txt
home/kira/compress/df0208.txt
home/kira/compress/df0209.txt
home/kira/compress/df0210.txt
home/kira/compress/df0211.txt
home/kira/compress/df0212.txt
home/kira/compress/df0213.txt
home/kira/compress/df0214.txt
home/kira/compress/df0215.txt
home/kira/compress/df0216.txt
home/kira/compress/df0217.txt
home/kira/compress/df0218.txt
home/kira/compress/df0219.txt
home/kira/compress/df0220.txt
home/kira/compress/df0221.txt
home/kira/compress/df0222.txt
home/kira/compress/df0223.txt
home/kira/compress/df0224.txt
home/kira/compress/df0225.txt
home/kira/compress/df0226.txt
home/kira/compress/df0227.txt
home/kira/compress/df0228.txt

man tar

-P, --absolute-names
              don't strip leading `/'s from file names

我试试了xiaobaibbb 的方法,可以了,谢谢大家了。下次解压的时候会注意路径的问题。



您对本贴的看法:
阅读(2579) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~