Andre Poenitz wrote:
On Thu, Jan 03, 2008 at 09:44:23AM -0500, rgheck wrote:
Jean-Marc Lasgouttes wrote:
rgheck <[EMAIL PROTECTED]> writes:
One other small thing. Instead of the repeated directory creation
stuff, what about something like this:
function mkpath {
base=shift;
for dir in $*; do
base="$base/$dir";
if test -d $base; then continue; fi
mkdir $base;
done
}
to be called as:
mkpath ${HOME}/Library texmf tex latex lyx;
Not tested, though.
What is wrong about directly calling "mkdir -p" to create the deepest
directory and the other ones as needed?
I was assuming the script was supposed to run on a very minimal shell. Is
this always supported?
Well, your script breaks in case ${HOME} contains spaces, doesn't it?
Should have been quoted, and with [EMAIL PROTECTED]
I am not sure this outweighs the benefits of running in a possible
non-existing environmnet where "mkdir" does not handle "-p".
I'm not familiar with all the shells there are out there, so wasn't sure
if mkdir would handle it on all the common ones. I'm pretty much a bash'er.
rh