Hi All,
On Jul 27, 2007, at 1:14 AM, Torsten Rohlfing wrote:
> Hi there --
>
> I have a suggestion: maybe the last line in $FSLDIR/bin/fast, "rm -rf
> ${tmpbase}*" is not such a great idea. Somehow, $FSLDIR/bin/tmpnam
> didn't work on one of my machines. Not idea what exactly happened, but
> it apparently returned an empty string. You are probably guessing what
> happened next -- I lost an entire project filesystem with some 30GB of
> data. Well, I didn't really lose anything, thanks to nightly backup
> images, that's the good news :)
>
> Anyway, how about making sure $tmpbase is actually defined and not
> empty
> before calling rm? Might save someone else who's not so lucky a
> world of
> pain.
Well, what about just guarding it; say changing from:
if [ X${tmpbase} != X ] ; then
rm -rf ${tmpbase}*
fi
to
if [ X${tmpbase} != X ] ; then
if [ ${#tmpbase} != 0 ] ; then
rm -rf ${tmpbase}*
fi
fi
In other words, make sure tmpbase is not empty, that should deal with
your error escalation.
The one thing I should admit, is I did not test the really well, and
I am somewhat clumsy in sh and bash...
ahoi & good luck
Sebastian
>
> Best,
> Torsten
>
> --
> Torsten Rohlfing, PhD SRI International, Neuroscience Program
> Research Scientist 333 Ravenswood Ave, Menlo Park, CA
> 94025
> Phone: ++1 (650) 859-3379 Fax: ++1 (650) 859-2743
> [log in to unmask] http://www.stanford.edu/~rohlfing/
>
> "Though this be madness, yet there is a method in't"
--
Sebastian Moeller
Tel.: 04 21 - 2 18 - 78 38 oder 96 91
Fax.: 04 21 - 2 18 - 90 04
GSM: 01 62 - 3 25 45 59
[log in to unmask]
AG Kreiter / FB 2
Institut fuer Hirnforschung III
Abteilung Theoretische Neurobiologie
Universitaet Bremen
Biogarten
Hochschulring 16a
Postfach 33 04 40
28359 Bremen
|