/usr/share/xcrysden/xcrysden 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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | #!/bin/sh -f
##############################################################################
# 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 3822 #
# Jamova 39, SI-1000 Ljubljana #
# SLOVENIA #
# #
# Copyright (c) 1996--2012 by Anton Kokalj #
##############################################################################
# set locales to C
LANG=C
LC_ALL=C
export LANG LC_ALL
unset MALLOC_CHECK_; # Lorenzo's good suggestion !
if test "x`type readlink`" = "x"; then
# no readlink cmd; make a function-substitute
readlink() {
echo `ls -l $1 | awk '{print $1}'`
}
fi
pathname() {
file=`type -p $1`
if test $? -gt 0; then
file=`which $1`
if test $? -gt 0; then
# give-up
file=$1
fi
fi
echo $file
}
pathdir() {
file=`pathname $1`
while test -h $file; do
file=`readlink $file`
done
dir=`dirname $file`
( cd $dir; pwd )
}
if test -z $XCRYSDEN_TOPDIR; then
# XCRYSDEN_TOPDIR does not exists, guess it from the process
export XCRYSDEN_TOPDIR=`pathdir $0`
fi
if test -z $XCRYSDEN_SCRATCH; then
# XCRYSDEN_SCRATCH does not exists, use /tmp
export XCRYSDEN_SCRATCH=/tmp
fi
if test \( "$1" = "-h" \) -o \( "$1" = "--help" \) ; then
cat $XCRYSDEN_TOPDIR/usage | awk 'BEGIN {lprint=0;} /a*/ { if (lprint) print; } /## do not edit/ { lprint=1; }'
exit 0
fi
ver=`cat $XCRYSDEN_TOPDIR/version`
if test \( "$1" = "-v" \) -o \( "$1" = "--version" \) ; then
echo "XCrySDen version: $ver"
exit 0
fi
# ------------------------------------------------------------------------
# parse the following options: -d -t -T
# ------------------------------------------------------------------------
valgrind=0
debug=0
USE=""
for opt in "$@"
do
case $opt
in
-d|--debug) debug=1; shift;;
-m|--valgrding) valgrind=1; shift;;
-t|--trace) XCRYSDEN_TRACE=1; export XCRYSDEN_TRACE; shift;;
-T|--fulltrace) XCRYSDEN_FULLTRACE=1; export XCRYSDEN_FULLTRACE; shift;;
-u|--use) shift; USE="-use $1"; shift;;
esac
done
if test \( $debug -eq 1 \) -a \( $valgrind -eq 1 \) ; then
echo "
XCRYSDEN: cannot use \"-d\" and \"-m\" options simultaneously !!!
"
exit 1
fi
if test ! -d $XCRYSDEN_SCRATCH ; then
mkdir $XCRYSDEN_SCRATCH
fi
#
# handle STDIN !!!
#
if test \( $# -eq 1 \) -a \( "$1" = "-" \) ; then
#
# read XSF from stdin
#
cat - > $XCRYSDEN_SCRATCH/STDIN.$$
ARGS="--xsf $XCRYSDEN_SCRATCH/STDIN.$$"
elif test \( $# -eq 2 \) -a \( "$2" = "-" \) ; then
#
# read from STDIN (all formats)
#
cat - > $XCRYSDEN_SCRATCH/STDIN.$$
ARGS="$1 $XCRYSDEN_SCRATCH/STDIN.$$"
fi
echo "
+-----------------------------------------------------------------+
|*****************************************************************|
|* *|
|* XCrySDen -- (X-Window) CRYstalline Structures and DENsities *|
|* = === = === *|
|*---------------------------------------------------------------*|
|* *|
|* Anton Kokalj (tone.kokalj@ijs.si) *|
|* Jozef Stefan Institute, Ljubljana, Slovenia *|
|* *|
|* Copyright (c) 1996--2012 by Anton Kokalj *|
|* *|
|*****************************************************************|
+-----------------------------------------------------------------+
Version: $ver
Please report bugs to: tone.kokalj@ijs.si
TERMS OF USE:
-------------
XCRYSDEN is released under the GNU General Public License.
Whenever graphics generated by XCRYSDEN are used in scientific
publications, it shall be greatly appreciated to include an explicit
reference. The preferred form is the following:
[ref] A. Kokalj, Comp. Mater. Sci., Vol. 28, p. 155, 2003.
Code available from http://www.xcrysden.org/.
"
#
# create SIGNAL HANDLER
#
. $XCRYSDEN_TOPDIR/scripts/xcLib.sh
trap 'xcSignalHandler XCrySDen 1' 1
trap 'xcSignalHandler XCrySDen 2' 2
trap 'xcSignalHandler XCrySDen 3' 3
trap 'xcSignalHandler XCrySDen 15' 15
if test -d $XCRYSDEN_TOPDIR/external/lib ; then
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="$XCRYSDEN_TOPDIR/external/lib"
else
LD_LIBRARY_PATH="$XCRYSDEN_TOPDIR/external/lib:$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH
if test -z "${DYLD_LIBRARY_PATH}"; then
DYLD_LIBRARY_PATH="$XCRYSDEN_TOPDIR/external/lib"
else
DYLD_LIBRARY_PATH="$XCRYSDEN_TOPDIR/external/lib:$DYLD_LIBRARY_PATH"
fi
export DYLD_LIBRARY_PATH
fi
for tcl_version in 8.5 8.4;
do
if test -f $XCRYSDEN_TOPDIR/external/lib/tcl$tcl_version/init.tcl ; then
export TCL_LIBRARY=$XCRYSDEN_TOPDIR/external/lib/tcl$tcl_version
echo "TCL_LIBRARY=$TCL_LIBRARY"
break
fi
done
####
if test ! -z $XCRYSDEN_LIB_BINDIR; then
XCRYSDEN_XCRYS_DIR=$XCRYSDEN_LIB_BINDIR
else
XCRYSDEN_XCRYS_DIR=$XCRYSDEN_TOPDIR/bin
fi
####
if test $debug -eq 1; then
ldd $XCRYSDEN_XCRYS_DIR/xcrys
fi
printenv | grep XCRYSDEN_TOPDIR
printenv | grep XCRYSDEN_SCRATCH
echo ""
if test $valgrind -eq 0 ; then
if test $debug -eq 0 ; then
if test -f ${XCRYSDEN_XCRYS_DIR}/xcrys.dll ; then
# CYGWIN: xcrys.dll will be loaded from xcInit.tcl !!!
if test "x$ARGS" != x; then
exec wish ${XCRYSDEN_TOPDIR}/Tcl/xcInit.tcl $USE -- \
$XCRYSDEN_TOPDIR $XCRYSDEN_SCRATCH $ARGS > /dev/null &
else
exec wish ${XCRYSDEN_TOPDIR}/Tcl/xcInit.tcl $USE -- \
$XCRYSDEN_TOPDIR $XCRYSDEN_SCRATCH "$@" > /dev/null &
fi
else
# testing
if test "x$ARGS" != x; then
${XCRYSDEN_XCRYS_DIR}/xcrys \
${XCRYSDEN_TOPDIR}/Tcl/xcInit.tcl $USE -- \
$XCRYSDEN_TOPDIR $XCRYSDEN_SCRATCH $ARGS > /dev/null &
else
${XCRYSDEN_XCRYS_DIR}/xcrys \
${XCRYSDEN_TOPDIR}/Tcl/xcInit.tcl $USE -- \
$XCRYSDEN_TOPDIR $XCRYSDEN_SCRATCH "$@" > /dev/null &
fi
wait $!
fi
else
#
# DEBUGGING ...
#
XCRYSDEN_DEBUG=1
export XCRYSDEN_DEBUG
DBGFILE=`mktemp -t gdb-XXXXXX`
echo "" > $DBGFILE
if test -f BREAKS ; then
cat BREAKS > $DBGFILE
fi
echo "" >> $DBGFILE
echo "run $XCRYSDEN_TOPDIR/Tcl/xcInit.tcl $XCRYSDEN_TOPDIR $XCRYSDEN_SCRATCH \\" >> $DBGFILE
if test "x$ARGS" != x; then
echo "$ARGS" >> $DBGFILE
else
echo "$@" >> $DBGFILE
fi
if test -f ${XCRYSDEN_XCRYS_DIR}/xcrys.dll ; then
# CYGWIN: I couldn't get debugging running under cygwin (t.k.)
echo "Ups, debugging does not yet work under CYGWIN !!!"
exit 1
else
gdb $XCRYSDEN_XCRYS_DIR/xcrys -x $DBGFILE
fi
fi
else
if test -f ${XCRYSDEN_XCRYS_DIR}/xcrys.dll ; then
# CYGWIN: xcrys.dll will be loaded from xcInit.tcl !!!
echo "
WARNING: don't know how to use valgrind on CYGWIN !!!
"
exit 1
else
#
# VALGRIND (i.e. memory checking) !!!
#
# --leak-check=full
if test "x$ARGS" != x; then
valgrind --leak-check=full ${XCRYSDEN_XCRYS_DIR}/xcrys \
${XCRYSDEN_TOPDIR}/Tcl/xcInit.tcl $USE -- \
$XCRYSDEN_TOPDIR $XCRYSDEN_SCRATCH $ARGS > /dev/null &
else
valgrind --leak-check=full ${XCRYSDEN_XCRYS_DIR}/xcrys \
${XCRYSDEN_TOPDIR}/Tcl/xcInit.tcl $USE -- \
$XCRYSDEN_TOPDIR $XCRYSDEN_SCRATCH $@ > /dev/null &
fi
wait $!
fi
fi
if test -f $PWD/core ; then
rm -f core
fi
exit 0
|