Andreas Vox wrote: > < I think we're getting a little too involved with generics here, given > that < this script is to be used to move .fig files into the temp > directory only. < I think that the test below should do the job and > should be portable. < > < PRESENT_DIR=$PWD > < > < cd `dirname "$1"` || exit $? > < FROM_DIR=$PWD > < > > cd "$PRESENT_DIR" > > Otherwise relative paths for $2 are relative to $1.
Thanks. > < cd `dirname "$2"` || exit $? > < TO_DIR=$PWD > < > < cd "$PRESENT_DIR" > < > < test "$FROM_DIR" = "$TO_DIR" && { > < # The "to" and "from" files are in the same directory. > < cp "$1" "$2" > < exit $? > < } > > Doesn't resolve symlinks on Mac :-( and I repeat: this script is to be used to move .fig files into the temp directory only. The worst case is that the directories are flagged as different and so 'sed' is used rather than 'cp'. Explain to me why that is a problem in real life rather than in some hypothetical situation. Why am I being a PITA? Because 'pwd -[PL]' is a bash shell built-in, not a POSIX command that comes with each and every *nix box. Examples that don't implement '-L': FreeBSD, Tru64 Unix. -- Angus