It is currently Thu, 20 Jan 2022 04:10:58 GMT



 
Author Message
 % /bin/sh -c /bin/ls -l -R ???
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

--
R. Purushotham                          Email: rud...@saphir.cl.bull.fr
F7 1 D5 BULL SA                         Tel Off: 34627000 ext 3928
78340 Les Clayes sous Bois  FRANCE      Tel Res: 34604752
=======================================================================



 Tue, 04 May 1993 18:19:00 GMT   
 % /bin/sh -c /bin/ls -l -R ???
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 | an...@littlei.intel.com
    ...!uunet!littlei!andyc          | an...@littlei.uu.net

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



 Mon, 17 May 1993 23:51:10 GMT   
 
   [ 2 post ] 

Similar Threads

1. /usr/bin/ls /usr/ucb/ls /usr/local/bin/ls

2. /usr/bin/ls and /usr/xpg4/bin/ls report different file attributes

3. FTP keeps using /usr/bin/ls and not ~/ftp/bin/ls

4. #!/bin/sh #!/usr/bin/sh can I do both for 2 diff machines

5. /bin/ls and /bin/echo * same or not?

6. /bin/sh, /bin/ksh crash with SIGSEGV with a huge script

7. /bin/ksh vs /usr/xpg4/bin/sh

8. /bin/sh and /usr/bin/ksh

9. re : /bin/sh:/bin/tar:0403-027:parameter list is too long


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software