home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / question / 14743 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.7 KB

  1. Xref: sparky comp.unix.questions:14743 comp.unix.shell:5091
  2. Path: sparky!uunet!pipex!doc.ic.ac.uk!uknet!acorn!ixi!ixi!pd
  3. From: pd@x.co.uk (Paul Davey)
  4. Newsgroups: comp.unix.questions,comp.unix.shell
  5. Subject: Re: How do I invoke a login shell.
  6. Message-ID: <PD.92Dec16151507@mull.x.co.uk>
  7. Date: 16 Dec 92 15:15:07 GMT
  8. References: <34657@adm.brl.mil>
  9. Sender: paul@x.co.uk (Paul Davey)
  10. Organization: Not a lot
  11. Lines: 34
  12. In-Reply-To: 92700217@vax1.dcu.ie's message of 14 Dec 92 14:34:09 GMT
  13. X-Disclaimer: This is not the view of IXI Ltd unless explicitly stated.
  14. X-Copyright: The author asserts the right of paternity in this message.
  15.  
  16.  
  17. Posted in comp.unix.wizards: 
  18.  
  19. >>>>> On 14 Dec 92 14:34:09 GMT, 92700217@vax1.dcu.ie (Ciaran Treanor) said:
  20.  
  21. Ciaran> Hi Wizards, I know this is probably not the right place to ask
  22. Ciaran> this question but I need an answer in a hurry.
  23.  
  24. Which begs the question why are you asking in the wrong place?
  25.  
  26. Let's hope you are checking the right place.
  27.  
  28. Ciaran> I want to "exec" /bin/csh as a login shell from a script file.
  29.      ...
  30. Ciaran>         How do you invoke /bin/csh with a name that starts
  31. Ciaran> with a '-'?  Do you mess around with argv[0], if so how do you
  32. Ciaran> do that in a shell script?  Is there any other of invoking a
  33. Ciaran> login /bin/csh?
  34.  
  35. From (C) shell    (dirty trick)
  36.  
  37.     % set path = ( $path ~ )
  38.     % ln -s /bin/csh ~/-csh
  39.     % exec -csh
  40.  
  41. Under the X Window System,
  42.     % exec xterm -ls 
  43.  
  44. From C
  45.     path = "/bin/csh";
  46.     argv[0] = "-csh";
  47.     argv[1] = (char *) 0;
  48.     printf ("execve failed \n", execve (path, argv, NULL));
  49.  
  50. --
  51.     Regards,            IXI            Internet: pd@x.co.uk
  52.     Paul Davey        Vision Park    UUCP:     pd@ixi.uucp
  53.                 Cambridge      Bang:     ...!uunet!ixi!pd
  54.  "These are interesting times"    CB4 4ZR, UK    Tel:      +44 223 236 555
  55.