🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.lang.c
Article #15033

Re: probleme avec les fonctions exec...

#15033
From: Thierry B
Date: Sat, 15 Oct 2005 17:04
23 lines
1801 bytes
Re,

J'ai essayé comme ceci:
case 5:{
	char *tab[3] = {"echo","$PATH",NULL};
	char *env[2]= {"PATH=/var", NULL};
	printf("FILS %d va faire un echo $PATH\n", i+1);
	execve("/bin/sh",tab,env);
	perror("execve");
	return 0;
	break;
      }

Comme ca je lui définis quand même une variable PATH (c pour un exo
lol sinon c'est sur que ca sert à rien de la défninir comme ca).

Mais ca me donne ca :-(

FILS 6 va faire un echo $PATH
echo: $PATH: No such file or directory

Merci
A+
Technical Details
Message-ID: <1129395856.353080.101040@g14g2000cwa.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail
References: <1129391183.461767.154610@z14g2000cwz.googlegroups.com> <43513026$0$986$8fcfb975@news.wanadoo.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,f48dca767454f981
X-Google-Attributes: gidf9822,public
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail
From: "Thierry B" <thierry.bouhnik@gmail.com>
Newsgroups: fr.comp.lang.c
Subject: Re: probleme avec les fonctions exec...
Date: 15 Oct 2005 10:04:16 -0700
Organization: http://groups.google.com
Lines: 24
Message-ID: <1129395856.353080.101040@g14g2000cwa.googlegroups.com>
References: <1129391183.461767.154610@z14g2000cwz.googlegroups.com>
   <43513026$0$986$8fcfb975@news.wanadoo.fr>
NNTP-Posting-Host: 82.224.47.63
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1129395861 29162 127.0.0.1 (15 Oct 2005 17:04:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 15 Oct 2005 17:04:21 +0000 (UTC)
In-Reply-To: <43513026$0$986$8fcfb975@news.wanadoo.fr>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.7.12) Gecko/20050920 Firefox/1.0.7,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: g14g2000cwa.googlegroups.com; posting-host=82.224.47.63;
   posting-account=8zpqDA0AAACpm8oU5_TKS1gqRyX3CEVa