WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

Antwort
 
Themen-Optionen Ansicht
Alt 08.05.2004, 15:47   #1
Theoden
Supportschani
 
Registriert seit: 30.07.2000
Beiträge: 3.466


Standard glade(gtk+) / C: Wie shellkommandos oder shellskripts ausführen lassen ?

Habe mit glade ein Projekt erstellt(geht um das HTPC Diplomprojekt), und das erstellt ja wiederum C Programme(main.c).

Wie kann ich jetz in diesem C Programm Shell Kommandos ausführen lassen, oder besser shellscripts starten ?
____________________________________
»I just looked in the mirror
Things aren't looking so good
I'm looking California
And feeling Minnesota«
Theoden ist offline   Mit Zitat antworten
Alt 08.05.2004, 16:12   #2
Theoden
Supportschani
 
Registriert seit: 30.07.2000
Beiträge: 3.466


Standard

Ok, habs rausgefunden:

Mit dem system(..) Parameter.
____________________________________
»I just looked in the mirror
Things aren't looking so good
I'm looking California
And feeling Minnesota«
Theoden ist offline   Mit Zitat antworten
Alt 08.05.2004, 23:21   #3
Theoden
Supportschani
 
Registriert seit: 30.07.2000
Beiträge: 3.466


Standard

So jetz häng ich wieder..

Wie kann ich System() eine variable übergeben?

Code:
System("%s",&bla);
funzt nicht.
____________________________________
»I just looked in the mirror
Things aren't looking so good
I'm looking California
And feeling Minnesota«
Theoden ist offline   Mit Zitat antworten
Alt 10.05.2004, 10:55   #4
Who-T
Elite
 
Registriert seit: 01.08.2000
Beiträge: 1.395


Who-T eine Nachricht über ICQ schicken
Standard

Code:
  char * exec = "ls -l";
  system (exec);
isses das was du machen willst?
____________________________________
Whoever built humanity left in a major design flaw: it was the tendency to bend at the knees.
Who-T ist offline   Mit Zitat antworten
Alt 10.05.2004, 12:22   #5
Theoden
Supportschani
 
Registriert seit: 30.07.2000
Beiträge: 3.466


Standard

Jein.

Ich wollte an ein shell kommando eine variable übergeben.

Das sieht dann so aus:
Code:
sprintf (befehl, "xmms-shell -e \"load %s\"",*pfad);
system(befehl);
____________________________________
»I just looked in the mirror
Things aren't looking so good
I'm looking California
And feeling Minnesota«
Theoden ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 01:43 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag