Article View: comp.unix.shell
Article #1861Re: % /bin/sh -c /bin/ls -l -R ???
From: Andy Crump
Date: Thu, 29 Nov 1990 15:51
Date: Thu, 29 Nov 1990 15:51
30 lines
1690 bytes
1690 bytes
>>>>> On 16 Nov 90 10:19:00 GMT, rudrak@saphir.cl.bull.fr (Rudrakshala Purushotham) said:
Rudrakshala> Originator: rudrak@saphir
Rudrakshala> I want run the command in subject from c-shell prompt. The problem is
Rudrakshala> it goes through .login and runs /bin/ls only.
Rudrakshala> I tried
Rudrakshala> % /bin/sh -c "/bin/ls -l -R"
I don't believe .profile is invoked when /bin/sh -c is used. Only at
login if argv[0] is "-sh". I tried this under csh on Sun OS, and
Intel System V Release 4 version 2.0 and had no problem getting it to
recognize the -l -R options.
Rudrakshala> it works as expected. What are the other ways of doing this. How does
Rudrakshala> shell escape functions handle this in a C program using execv () ?
The C program can call system(), which essentially does the same thing
or if using execv(), they will build up the argv vector and pass it to
execv().
--
-- Andy Crump
...!tektronix!reed!littlei!andyc | andyc@littlei.intel.com
...!uunet!littlei!andyc | andyc@littlei.uu.net
Disclaimer: Any opinions expressed here are my own and
not representive of Intel Corportation.
Technical Details
Message-ID:
<ANDYC.90Nov29155110@bucky.intel.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uwm.edu!ogicse!littlei!gandalf!andycReferences:
<346@clbull.cl.bull.fr>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uwm.edu!ogicse!littlei!gandalf!andyc From: andyc@bucky.intel.com (Andy Crump) Newsgroups: comp.unix.shell Subject: Re: % /bin/sh -c /bin/ls -l -R ??? Message-ID: <ANDYC.90Nov29155110@bucky.intel.com> Date: 29 Nov 90 15:51:10 GMT References: <346@clbull.cl.bull.fr> Sender: news@littlei.UUCP Organization: Intel Corporation, Hillsboro, Oregon Lines: 30 In-reply-to: rudrak@saphir.cl.bull.fr's message of 16 Nov 90 10:19:00 GMT