home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:14743 comp.unix.shell:5091
- Path: sparky!uunet!pipex!doc.ic.ac.uk!uknet!acorn!ixi!ixi!pd
- From: pd@x.co.uk (Paul Davey)
- Newsgroups: comp.unix.questions,comp.unix.shell
- Subject: Re: How do I invoke a login shell.
- Message-ID: <PD.92Dec16151507@mull.x.co.uk>
- Date: 16 Dec 92 15:15:07 GMT
- References: <34657@adm.brl.mil>
- Sender: paul@x.co.uk (Paul Davey)
- Organization: Not a lot
- Lines: 34
- In-Reply-To: 92700217@vax1.dcu.ie's message of 14 Dec 92 14:34:09 GMT
- X-Disclaimer: This is not the view of IXI Ltd unless explicitly stated.
- X-Copyright: The author asserts the right of paternity in this message.
-
-
- Posted in comp.unix.wizards:
-
- >>>>> On 14 Dec 92 14:34:09 GMT, 92700217@vax1.dcu.ie (Ciaran Treanor) said:
-
- Ciaran> Hi Wizards, I know this is probably not the right place to ask
- Ciaran> this question but I need an answer in a hurry.
-
- Which begs the question why are you asking in the wrong place?
-
- Let's hope you are checking the right place.
-
- Ciaran> I want to "exec" /bin/csh as a login shell from a script file.
- ...
- Ciaran> How do you invoke /bin/csh with a name that starts
- Ciaran> with a '-'? Do you mess around with argv[0], if so how do you
- Ciaran> do that in a shell script? Is there any other of invoking a
- Ciaran> login /bin/csh?
-
- From (C) shell (dirty trick)
-
- % set path = ( $path ~ )
- % ln -s /bin/csh ~/-csh
- % exec -csh
-
- Under the X Window System,
- % exec xterm -ls
-
- From C
- path = "/bin/csh";
- argv[0] = "-csh";
- argv[1] = (char *) 0;
- printf ("execve failed \n", execve (path, argv, NULL));
-
- --
- Regards, IXI Internet: pd@x.co.uk
- Paul Davey Vision Park UUCP: pd@ixi.uucp
- Cambridge Bang: ...!uunet!ixi!pd
- "These are interesting times" CB4 4ZR, UK Tel: +44 223 236 555
-