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

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

Post by Rudrakshala Purushoth » Sat, 17 Nov 1990 19:19:00



I want run the command in subject from c-shell prompt. The problem is
it goes through .login and runs /bin/ls only.
I tried

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

it works as expected. What are the other ways of doing this. How does
shell escape functions handle this in a C program using execv () ?

Thanks for any help in advance.

-- Purush

--

F7 1 D5 BULL SA                         Tel Off: 34627000 ext 3928
78340 Les Clayes sous Bois  FRANCE      Tel Res: 34604752
=======================================================================

 
 
 

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

Post by Andy Cru » Sat, 01 Dec 1990 00:51:10



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



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