% /bin/sh -c /bin/ls -l -R ???

Andy Crump andyc at bucky.intel.com
Fri Nov 30 02:51:10 AEST 1990


>>>>> On 16 Nov 90 10:19:00 GMT, rudrak at saphir.cl.bull.fr (Rudrakshala Purushotham) said:
Rudrakshala> Originator: rudrak at 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 at littlei.intel.com
    ...!uunet!littlei!andyc          | andyc at littlei.uu.net

Disclaimer: Any opinions expressed here are my own and 
            not representive of Intel Corportation.



More information about the Comp.unix.shell mailing list