thanks,
works great.

Alon.

Ehud Karni wrote:

>On Tue, 8 Oct 2002 00:13:39 +0200, Ilya Konstantinov <[EMAIL PROTECTED]> 
>wrote:
>  
>
>>1. Mount the ISOs into different directories.
>>2. Use my "union" utility to consolidate the different directories into one
>>single directory. It creates directories and symbolic links as necessary, so
>>that the target directory almost doesn't take up any disk space.
>>
>>Usage:
>>union source-dir1 source-dir2 source-dir2 ... target-dir
>>
>>(Tip: If you want to offer those files via FTP, like we do, make the source
>>directory paths relative -- because your FTP site doesn't begin at /)
>>
>>You can get it from
>>http://toast.unwind.co.il/hacks/union
>>    
>>
>
>This union script is a VERY nice idea. I rewritten your perl script in
>shell (I consider sh/bash more portable then perl), See below.
>
>Ehud.
>
>
>#! /bin/sh -e
># Compile by: /bin/sh -ex $*
>#
># 1st  arg  = target-dir
># more args = sources dirs (to be symlinks)
># --------------------------------------------------
>
>walk_dir ()                                # walk all files on dir $1 (abs path)
>{                                          # make symlinks / create dirs on $2 (abs 
>path)
>    SRC="$1"                               # source dir
>    DEST="$2"                              # destination
>    mkdir -p "$DEST"                       # create dir if does not exist
>    RLTV="$SRC"        ########## FIX ME - relative address of $SRC to $DEST
>
>    cd $SRC                                # work in source dir
>    for SUBD in *                          # do for all files/dirs
>    do
>        DSUB="$DEST/$SUBD"                 # destination subdir
>        if [ -d "$SUBD" ] ; then           # directory ?
>            ( walk_dir "$SRC/$SUBD" "$DSUB" )  # walk this subdir (in subshell)
>        else
>            if [ -e "$DSUB" ] ; then       # name already exists
>                echo "File $DSUB is multply defined, see below"
>                ls -al "$DSUB"             # previous (symlink)
>                ls -al "$SRC/$SUBD"        # current
>                echo " "
>                ERR=ON                     # error occurred
>            else
>                ln -s "$RLTV/$SUBD" "$DSUB" # create symbolic link (RELATIVE)
>            fi
>        fi
>    done
>}
># ----------------------------------------------------------------------
>
>umask 022                                  # read for all
>
>TRGT=$1                                    # target dir
>shift                                      # leave only source dirs
>CRNT=`pwd`                                 # save current dir
>mkdir -p $TRGT                             # create $TRGT if does not exist
>cd $TRGT
>TRGT=`pwd`                                 # Target dir (absolute form)
>ERR=""                                     # no error switch
>
>for SDIR in $@                             # work on all source dirs
>do
>    cd "$CRNT"                             # needed if source dir is relative path
>    cd "$SDIR"
>    CSDR=`pwd`                             # for error messages
>    walk_dir "$CSDR" "$TRGT"               # walk all files on dir $CSDR
>done
>
>############################## union.sh ##############################
>
>
>--
> Ehud Karni           Tel: +972-3-7966-561  /"\
> Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
> Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
> http://www.mvs.co.il  FAX:  1-815-5509341  / \
> mailto:[EMAIL PROTECTED]                  Better  Safe  Than  Sorry
>
>=================================================================
>To unsubscribe, send mail to [EMAIL PROTECTED] with
>the word "unsubscribe" in the message body, e.g., run the command
>echo unsubscribe | mail [EMAIL PROTECTED]
>
>.
>
>  
>




=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to