|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Newbie ksh script help
I need a ksh script that will make tar files of a list of directories. my problem is that I need a single tarball for each directory. the tarball needs to have the same name as the directory with the .tar.Z extension.
I'm thinking I need to make an array with the names of the directories and then feed each of them through tar, but I'm not sure of how to do this. In case you're wondering why I need this, each directory is a separate job. Each job is tarred by itself and then when i have enough to fill up a dvd, i backup. thanks |
|
#2
|
|||
|
|||
|
got it
thanks anyways, figured it out with a for loop
#! /bin/ksh for foo in $(ls);do if [[ -d $foo ]];then tar -cfZ $foo.tar $foo done |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Newbie ksh script help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|