|
Hi,
I think that the 'mktemp' command (which create a temporary
file with a *unic* name) can be usefull here:
# Create ('-c' option) a 0-length file in the tmp area
typeset -i RC
typeset LP_FILE_PATH=$(mktemp -c); RC=$?
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: cannot create a temporary file"
return ${RC}
fi
# Extract the file name (supposed to be unic)
typeset LP_UNIC_NAME=${LP_FILE_PATH##*/}
# ...
# Do your stuff
# ...
# Don't forget to cleanup the temporary area!
# (to be done at the *END*)
rm -f ${LP_FILE_PATH}
Hope it helps,
C.
|