home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!eiffel!eiffel.com
- From: ram@eiffel.com (Raphael Manfredi)
- Newsgroups: comp.lang.perl
- Subject: Re: checking for interactive shell
- Message-ID: <149@eiffel.eiffel.com>
- Date: 17 Nov 92 16:39:38 GMT
- References: <4254@bcstec.ca.boeing.com>
- Sender: ram@eiffel.com
- Distribution: usa
- Organization: Interactive Software Engineering, Santa Barbara CA
- Lines: 33
-
- Quoting ced@bcstec.ca.boeing.com (Charles Derykus) from comp.lang.perl:
- >How do I perlize the following Bourne shell fragment? (I
- >faq'ed fruitlessly)
- >
- > case "$-" in # interactive ?
- > s) ....
- >
-
- Hmm... Provided that by "interactive" you mean have the standard
- input connected to a tty, then the following should do it:
-
- if (-t) { # Interactive ?
- ...
- }
-
- This is not exactly how I would define "interactive" though. I always
- thought it was the -i flag from the shell which dictated whether the
- shell was interactive or not. As far as I recall, the -s flag means
- that when no more arguments are specified in the command line, then
- the shell continues and prompts from stdin.
-
- (A typical use is:
-
- remsh host sh -is
-
- which gives you a "remote shell" without the burden of rlogin.)
-
- This has little or no meaning for perl.
- --
- Raphael Manfredi <ram@eiffel.com>
- Interactive Software Engineering Inc.
- 270 Storke Road, Suite #7 / Tel +1 (805) 685-1006 \
- Goleta, California 93117, USA \ Fax +1 (805) 685-6869 /
-