Programmation shell (bash)
Fermé
touf_truc
Messages postés
57
Date d'inscription
samedi 21 octobre 2006
Statut
Membre
Dernière intervention
23 avril 2007
-
24 janv. 2007 à 18:13
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 - 16 janv. 2010 à 19:41
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 - 16 janv. 2010 à 19:41
Comment on peut utiliser les commande de gcc on utilisre programmation shell?
on ecrit un programme shell qui puisse compiler et executer des programmes on C
merci
on ecrit un programme shell qui puisse compiler et executer des programmes on C
merci
A voir également:
- Programmation shell (bash)
- Classic shell windows 11 - Télécharger - Personnalisation
- Application de programmation - Guide
- Bingo bash jeton gratuit - Télécharger - Divers Jeux
- Bash permission non accordée - Forum Shell
- Minimal bash-like line editing is supported ✓ - Forum Linux / Unix
6 réponses
rer_louz
Messages postés
276
Date d'inscription
mercredi 26 novembre 2003
Statut
Membre
Dernière intervention
29 décembre 2008
71
24 janv. 2007 à 18:17
24 janv. 2007 à 18:17
Bonjour.
Pas clair la question.
Ptet un exemple
gcc hello.c -o hello te compile le fichier hello.c pour te donner l'executable hello que tu lances avec la commande ./hello.
Mais je sais pas si c'est que tu voulais. reformule ta question svp.
A++
Pas clair la question.
Ptet un exemple
gcc hello.c -o hello te compile le fichier hello.c pour te donner l'executable hello que tu lances avec la commande ./hello.
Mais je sais pas si c'est que tu voulais. reformule ta question svp.
A++
mamiemando
Messages postés
33574
Date d'inscription
jeudi 12 mai 2005
Statut
Modérateur
Dernière intervention
14 mars 2025
7 833
25 janv. 2007 à 13:50
25 janv. 2007 à 13:50
Heu ce que tu cherches à faire c'est pas simplement un makefile ?
dubcek
Messages postés
18767
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
5 mars 2025
5 628
25 janv. 2007 à 15:48
25 janv. 2007 à 15:48
mamiemando a raison, la commande make a été inventée pour ça ...
lami20j
Messages postés
21331
Date d'inscription
jeudi 4 novembre 2004
Statut
Modérateur, Contributeur sécurité
Dernière intervention
30 octobre 2019
3 569
25 janv. 2007 à 16:35
25 janv. 2007 à 16:35
Salut,
je sais que Miss a raison :-)) je dirais la même chose
je sais que Miss a raison :-)) je dirais la même chose
touf_truc
Messages postés
57
Date d'inscription
samedi 21 octobre 2006
Statut
Membre
Dernière intervention
23 avril 2007
1
26 janv. 2007 à 11:06
26 janv. 2007 à 11:06
si je mis
#!/bin/bash
DIALOG=${DIALOG=dialog}
FILE='$DIALOG --stdout -- "Choisir un fichier" --fselect $HOME/ 14 48'
comment je peux terminer cette procedure?
#!/bin/bash
DIALOG=${DIALOG=dialog}
FILE='$DIALOG --stdout -- "Choisir un fichier" --fselect $HOME/ 14 48'
comment je peux terminer cette procedure?
jipicy
Messages postés
40842
Date d'inscription
jeudi 28 août 2003
Statut
Modérateur
Dernière intervention
10 août 2020
4 897
26 janv. 2007 à 11:35
26 janv. 2007 à 11:35
Re-
Alors déjà y'a un "os" dans ton bout de script, il manque "title" :
;-))
Alors déjà y'a un "os" dans ton bout de script, il manque "title" :
#!/bin/bash DIALOG=${DIALOG=dialog} FILE='$DIALOG --stdout --title "Choisir un fichier" --fselect $HOME/ 14 48'Ben une fois le fichier choisi, suffit d'exploiter la variable "$FILE" dans le reste de ton script...
;-))
touf_truc
Messages postés
57
Date d'inscription
samedi 21 octobre 2006
Statut
Membre
Dernière intervention
23 avril 2007
1
>
jipicy
Messages postés
40842
Date d'inscription
jeudi 28 août 2003
Statut
Modérateur
Dernière intervention
10 août 2020
26 janv. 2007 à 11:48
26 janv. 2007 à 11:48
mais Comment?
merci
merci
jipicy
Messages postés
40842
Date d'inscription
jeudi 28 août 2003
Statut
Modérateur
Dernière intervention
10 août 2020
4 897
>
jipicy
Messages postés
40842
Date d'inscription
jeudi 28 août 2003
Statut
Modérateur
Dernière intervention
10 août 2020
26 janv. 2007 à 11:53
26 janv. 2007 à 11:53
Ben tout dépend de ce que tu veux faire ensuite...
Si t'as un bout de code, poste-le, on essaiera d'adapter :-))
Si t'as un bout de code, poste-le, on essaiera d'adapter :-))
touf_truc
Messages postés
57
Date d'inscription
samedi 21 octobre 2006
Statut
Membre
Dernière intervention
23 avril 2007
1
>
jipicy
Messages postés
40842
Date d'inscription
jeudi 28 août 2003
Statut
Modérateur
Dernière intervention
10 août 2020
26 janv. 2007 à 12:02
26 janv. 2007 à 12:02
le but de ce code si de cree une boite dialog ensuite je selection un ficher parmi 3 fichiers) et apres je le compile et je l'execute.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
je veut un programme shell qui permer de creer n fichier ce nombre etant donné par parametre et qui ont format de file0.txt , ..........
et avec taille de 0 octey
et avec taille de 0 octey
jipicy
Messages postés
40842
Date d'inscription
jeudi 28 août 2003
Statut
Modérateur
Dernière intervention
10 août 2020
4 897
30 janv. 2008 à 23:11
30 janv. 2008 à 23:11
lami20j
Messages postés
21331
Date d'inscription
jeudi 4 novembre 2004
Statut
Modérateur, Contributeur sécurité
Dernière intervention
30 octobre 2019
3 569
24 janv. 2007 à 21:58
24 janv. 2007 à 21:58
Salut,
voici un exemple (le script et le fichiers hello1.c ... hello3.c se trouvent dans le même répertoire)
voici un exemple (le script et le fichiers hello1.c ... hello3.c se trouvent dans le même répertoire)
#!/bin/bash echo "==== MENU COMPILE ====" echo -e "1. hello1.c\n2. hello2.c\n3. hello3.c\n\n" echo -e "Faites votre choix : \c " read choix case $choix in '1') gcc -o hello1 hello1.c ./hello1 ;; '2') gcc -o hello2 hello2.c ./hello2 ;; '3') gcc -o hello3 hello3.c ./hello3 ;; *) echo "Mauvaise choix" esac
touf_truc
Messages postés
57
Date d'inscription
samedi 21 octobre 2006
Statut
Membre
Dernière intervention
23 avril 2007
1
25 janv. 2007 à 11:35
25 janv. 2007 à 11:35
merci pour cette exemple.
mais comment faire cette exemple on utlisant DIALOG
mais comment faire cette exemple on utlisant DIALOG
jipicy
Messages postés
40842
Date d'inscription
jeudi 28 août 2003
Statut
Modérateur
Dernière intervention
10 août 2020
4 897
25 janv. 2007 à 12:11
25 janv. 2007 à 12:11
Salut,
A optimisé selon tes besoins ...
A optimisé selon tes besoins ...
#!/bin/sh DIALOG=dialog $DIALOG --backtitle "MENU DE COMPILATION" \ --title "COMPILATION" \ --radiolist "Faites votre choix : " 0 0 0 \ "Hello1.c" "Compilation programme Hello1." off \ "Hello2.c" "Compilation programme Hello2." off \ "Hello3.c" "Compilation programme Hello3" off 2>/tmp/checklist.tmp.$$ retval=$? choix=`cat /tmp/checklist.tmp.$$` rm -f /tmp/checklist.tmp.$$ case $retval in 0) case $choix in Hello1.c) gcc -o hello1 hello1.c ./hello1 ;; Hello2.c) gcc -o hello2 hello2.c ./hello2 ;; Hello3.c) gcc -o hello3 hello3.c ./hello3 ;; esac ;; *) echo "Programme arrêté...";; esac;-))
24 janv. 2007 à 21:37
-tout d'abrd je doit ecrire un programme shell qu' il contient un menu revient sur les tois fichier
-si je selection le fichier hello1.c
le programme shell doit compiler et executer hello1.c , c'est la meme chose pour les autres fichier 2 et 3 .c
16 janv. 2010 à 19:26
$gcc -o hello hello.c
aussi celle-ci:
$gcc hello -o hello.c
ne marche chez moi et le Shell me dit que gcc est une commande introuvable alors que fais-je pour compiler hello.c et puis l'executer et merci d'avance.
16 janv. 2010 à 19:27
16 janv. 2010 à 19:35
16 janv. 2010 à 19:41