zip /gzip in bash
xinyou yan
yxy.716 at gmail.com
Tue Aug 30 16:57:04 UTC 2011
Hi every one ,
I was confuse to use gzip in shell.
You see below. I can use zip -gj make test.tar include the
testfile and the test1file
However , use gzip make the test_gzip.tar.gz NULL.
I see man and use gzip -c file >> tarname. to add a file to a tar file .
Can anyone tell me why?
You can let /root have two sample file testfile test1file
#!/bin/sh
anse='/root/test.tar'
anse_gzip='/root/test_gzip.tar.gz'
test='/usr/local/sbin/testfile'
test1='/usr/local/sbin/test1file'
zip -gj $anse $test
zip -gj $anse $test1
gzip -c $test >> $anse_gzip
gzip -c $test1 >> $anse_gzip
I think gzip can do what zip can do in linux .
If I just do
gzip -c testfile >> test_gzip.tar.gz
It can create the test_gzip.tar.gz file But can't include any file .
--
----------------------------------------------------------------
嘉谟之行
“昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏”
----------------------------------------------------------------
More information about the users
mailing list