Sunday 14 April 2013

Copy directory and sub-directories


#!/bin/ksh
#
tarpipe ()
{
   # create dest if not already
   [ ! -d "$2" ] && mkdir "$2"
   # copy it over
   tar cCf "$1" - . | tar xCf "$2" -
}

tarpipe "$1" "$2"

0 blogger-disqus:

Post a Comment