Hallo
Have got a strange problem:
I would like to test if a file exists and when it exists, I would show the contents in a konsole.
The command to do this is putted togeather in the shellskript within the variable "befehl"
For testing I show the contents of this variable (echo befehl).
The shellskript does not work properly: the konsole is opened, but without contents and is closed suddenly.
But when I copy&paste tehe command form "echo befehl" and paste it into the commandline, it works propperly!
Isn that strange?
Thandkds for tips
Philipp
======================Hiere my Shellskript:=======================
#Es soll getestet werden, ob eine Datei existiert und wenn , dann soll der Inhalt in einer Konsole angezeigt werden
#The script is started with the customerrś number in order to construct file named "ZVB[custemersNumber]
cd "/home/eigeneDaten/erwin/druck/"
for i
do
x="ZVB"$i
datei="/home/eigeneDaten/erwin/druck/"$x
if test -e $datei
chmod 777 /home/eigeneDaten/erwin/druck/ZVB*
then befehl1="konsole --vt_sz 150x10 --noscrollbar --nomenubar --noframe -e /bin/bash -l -c "
befehl2="' cat "
befehl3=" & sh ' &"
echo $befehl1
echo $befehl2
echo $befehl3
befehl=$befehl1$befehl2$datei$befehl3
echo $befehl
$befehl
i#und noch ein Versuch
befehl="konsole --vt_sz 150x10 --noscrollbar --nomenubar --noframe -e /bin/bash -l -c ""' cat "$datei" & sh ' &"
echo $befehl
$befehl
else
date >>/home/eigeneDaten/ERROR/shellscript_err.log
echo $i>>/home/eigeneDaten/ERROR/shellscript_err.log
fi
done