> I don't know if `basename` will help you with that or not.

 Yes!

That's way better.  That's the area where i will have to learn the most:
what functions are out there.  It's fun to learn the hard way, too,
though...

Thanks for the command,
eric


Here's the basename version:
--------------------------------

#!/bin/bash

FILEPATH=`pwd`   #will be reset to files' path if needed
echo $@ | grep -q /

if [ $? = 0 ] ; then

    # get filenames
    FILENAMES=''
    for item in $@; do
        FILENAMES=$FILENAMES" "`basename $item`
    done

    #get path
    FILEPATH=$(echo $1 | sed s/`basename $1`//)

else
    FILENAMES=$@
fi

echo $FILEPATH
cd $FILEPATH

tar -cvf tmp.tar $FILENAMES

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to