zip /gzip in bash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 .



-- 
----------------------------------------------------------------
嘉谟之行
“昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏”
----------------------------------------------------------------
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux