Does anybody know how “su -c ‘/opt/test/bin/testreport -a’ - testadmin >$OUTTESTDIR/test.txt 2>>$LOGFILE” could correctly be executed in SUSE linux?
Right now i have troubles with reading user environment variables of “testadmin” user, somehow it doesn’t work for me. In RH linux it works without problems, all testadmin environment variables are read while executing “/opt/test/bin/testreport” script.
sigw09-mco3:~ # uname -a
Linux sigw09-mco3 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
sigw09-mco3:~ #
sigw09-mco3:/etc # cat SuSE-release
openSUSE 10.2 (X86-64)
VERSION = 9.2
sigw09-mco3:/etc #
sigw09-mco3:~ # echo $SHELL
/bin/bash
sigw09-mco3:~ #
sigw09-mco3:~ # bash --version
GNU bash, version 3.1.17(1)-release (x86_64-suse-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
sigw09-mco3:~ #
Note: system where it works
[root@sigw09-mco2 ~]# bash --version
bash --version
GNU bash, version 3.00.15(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.
echo -ne “\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007”
[root@sigw09-mco2 ~]#
Notice that your script doesn’t have the shebang, so it should run by default with bash on a suse
system, not kshell, as you seem to indicate by your next paragraph.