Article View: comp.unix
Article #756Re: system command
From: Thanh Ma
Date: Thu, 06 Jul 1995 00:00
Date: Thu, 06 Jul 1995 00:00
33 lines
1725 bytes
1725 bytes
markjr@shmooze.net (Landslidius MarXaMis) writes:
>In article <3sprhr$6g6@venera.isi.edu>, gsingh@isi.edu (Gaurav Singh) says:
>>
>>Hi,
>>
>> I am trying to execute the "system" command to execute an application
>>(executable program).
>>However the system command does not work if the name of the application has been
>>aliased.
>>
>> e.g: $ alias test ps
>> $ test
>> (this works)
>>
>> however system("test"); in a c-program does not work.
>>
>> sh: test: not found
>>
>looks to me like you're shelling out to a bourne shell, judging
>from your err msg, and the alias cmd is in the C shell.
>off the top of my head try:
> system("tcsh test");
or specify the full pathname of test.
Thanh Ma
tma@encore.com
Technical Details
Message-ID:
<DBAr99.AzD@encore.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3sprhr$6g6@venera.isi.edu> <3tcshq$uf@inforamp.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,f653ab8f84d6a686 X-Google-Attributes: gidf8c9b,public X-Google-Thread: f72b0,f653ab8f84d6a686 X-Google-Attributes: gidf72b0,public X-Google-Thread: fc89c,f653ab8f84d6a686 X-Google-Attributes: gidfc89c,public X-Google-Thread: 10183f,f653ab8f84d6a686 X-Google-Attributes: gid10183f,public X-Google-Thread: 10f717,f653ab8f84d6a686 X-Google-Attributes: gid10f717,public X-Google-Thread: 1012a6,f653ab8f84d6a686 X-Google-Attributes: gid1012a6,public From: tma@encore.com (Thanh Ma) Subject: Re: system command Date: 1995/07/06 Message-ID: <DBAr99.AzD@encore.com> X-Deja-AN: 105731924 sender: news@encore.com (Usenet News) references: <3sprhr$6g6@venera.isi.edu> <3tcshq$uf@inforamp.net> organization: Encore Computer Corporation newsgroups: comp.unix,ca.unix,comp.unix.misc,comp.unix.programmer,comp.unix.questions,comp.unix.shell