/usr/share/xcrysden/scripts/xc_cleanscratch is in xcrysden-data 1.5.53-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #!/bin/sh
#############################################################################
# Author: #
# ------ #
# Anton Kokalj Email: Tone.Kokalj@ijs.si #
# Department of Physical and Organic Chemistry Phone: x 386 1 477 3523 #
# Jozef Stefan Institute Fax: x 386 1 477 3811 #
# Jamova 39, SI-1000 Ljubljana #
# SLOVENIA #
# #
# Source: $XCRYSDEN_TOPDIR/scripts/xc_cleanscratch
# ------ #
# Copyright (c) 1996-2003 by Anton Kokalj #
#############################################################################
if test x$XCRYSDEN_SCRATCH = x; then
echo "Exiting; XCRYSDEN_SCRATCH does not exists !!!"
exit 0
fi
DELETE_FILES=$XCRYSDEN_SCRATCH/xc_*
Question () {
echo "
XCRYSDEN_SCRATCH directory: $XCRYSDEN_SCRATCH/ will be cleaned
(i.e. rm -rf $DELETE_FILES).
The following files/directories will be deleted:
"
files=`ls $XCRYSDEN_SCRATCH/* 2> /dev/null`
if [ "$files" = "" ]; then
echo " XCRYSDEN_SCRATCH directory is empty !!!
"
exit
fi
echo "$files" | grep xc_
$ECHO_n "
Really delete? ([y]es/[n]o) "
read ans
if [ \( "$ans" != "y" \) -a \( "$ans" != "n" \) ]; then
echo "
-- Please answer y or n !!!"
Question
fi
}
#
# assuming user shell is csh or tcsh or sh
#
if [ "`echo -n a`" = "-n a" ]; then
ECHO_n=echo
else
ECHO_n="echo -n"
fi
Question
if [ "$ans" = y ]; then
$ECHO_n "
Deleting $DELETE_FILES ... "
cd $XCRYSDEN_SCRATCH/
rm -rf xc_*
echo "OK
"
fi
|