mirror of https://gitlab.com/QEF/q-e.git
70 lines
2.0 KiB
Bash
Executable File
70 lines
2.0 KiB
Bash
Executable File
#!/bin/sh
|
|
# ----------------------------------------------------------------------
|
|
# PROGRAM: pwgui_reformat
|
|
# PURPOSE: reformat the input for nice lookout of a particular PWSCF module
|
|
# ----------------------------------------------------------------------
|
|
# Anton Kokalj
|
|
# Jozef Stefan Institute, Ljubljana, Slovenia
|
|
# INFM DEMOCRITOS National Simulation Center, Trieste, Italy
|
|
# Email: Tone.Kokalj@ijs.si
|
|
# ======================================================================
|
|
# Copyright (c) 2003--2004 Anton Kokalj
|
|
# ======================================================================
|
|
#
|
|
#
|
|
# This file is distributed under the terms of the GNU General Public
|
|
# License. See the file `COPYING' in the root directory of the present
|
|
# distribution, or http://www.gnu.org/copyleft/gpl.txt .
|
|
#
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
# NONINFRINGEMENT. IN NO EVENT SHALL ANTON KOKALJ BE LIABLE FOR ANY
|
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
#
|
|
|
|
if test "x`type readlink`" = "x"; then
|
|
# no readlink cmd; make a function-substitute
|
|
readlink() {
|
|
echo `ls -l $1 | awk '{print $NF}'`
|
|
}
|
|
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 [ -z "$PWGUI" ]; then
|
|
# try to guess the PWGUI value
|
|
export PWGUI=`pathdir $0`
|
|
fi
|
|
|
|
|
|
if [ -d $PWGUI/bin ]; then
|
|
$PWGUI/bin/itkwish $PWGUI/pwgui_reformat.tcl $@
|
|
else
|
|
tclsh $PWGUI/pwgui_reformat.tcl $@
|
|
fi
|