Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 9th October 2007, 04:41 PM
philippjosefric Offline
Registered User
 
Join Date: Mar 2005
Posts: 106
a strange problem

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
Reply With Quote
  #2  
Old 10th October 2007, 07:56 AM
philippjosefric Offline
Registered User
 
Join Date: Mar 2005
Posts: 106
I cot the solution
see
http://www.fedoraforum.de/viewtopic.php?p=71507#71507
Code:
cat $datei
        echo -n "            ... weiter <Enter> ...   "
        read a
I have abanded the opening of a window, which is less comfortable, but more safe, because of problems with different terminals.
this is the skript for interessed people:
(aim of the skript: test if a file exist, if it does, show the contents, then remove the file):
Code:
cd "/home/eigeneDaten/erwin/druck/"
for i
    do
    x="ZVB"$i
    datei="/home/eigeneDaten/erwin/druck/"$x
    if test -e $datei
        then
        chmod 777 /home/eigeneDaten/erwin/druck/ZVB*
        cat $datei
        echo -n "            ... weiter <Enter> ...   "
        read a
        befehl="rm "$datei
        $befehl
    else
        date >>/home/eigeneDaten/ERROR/shellscript_err.log
        echo $datei" nicht gefunden !!">>/home/eigeneDaten/ERROR/shellscript_err.log
    fi
    done
Reply With Quote
Reply

Tags
problem, strange

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
strange problem beeloo Using Fedora 1 6th March 2009 05:20 PM
SMB file transfer performance. Strange strange strange geekboxnz Using Fedora 0 11th February 2006 08:55 AM


Current GMT-time: 03:16 (Sunday, 26-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat