Thread View: comp.unix.shell
5 messages
5 total messages
Started by james cloos
Tue, 04 Sep 1990 19:00
(t)csh if query
Author: james cloos
Date: Tue, 04 Sep 1990 19:00
Date: Tue, 04 Sep 1990 19:00
21 lines
1040 bytes
1040 bytes
Hello, I`m trying to set up my ~/.login file so that is the HOSTTYPE variable is set to "sun3" AND if the TERM variable is set to "sun" (My quotes, both times) then it should run the alias "X11". What I tried is: if ( ($HOSTTYPE)=sun3 && ($TERM)=sun ) X11 When .login saw this, it did nothing. When I typed it in a the tcsh prompt I got the message "if: Expression syntax." My obvious question, then, is what is the syntax of the if test expression in (t)csh? Thanx for any replies! -JimC -- James H. Cloos, Jr. cloos@acsu.buffalo.edu +1 716 673-1250 Personal ZipCode= 14048-0772
Re: (t)csh if query
Author: Jonathan I. Kamens
Date: Tue, 04 Sep 1990 19:13
Date: Tue, 04 Sep 1990 19:13
20 lines
1160 bytes
1160 bytes
In article <34710@eerie.acsu.Buffalo.EDU>, cloos@acsu.buffalo.edu (james cloos) writes: |> What I tried is: |> |> if ( ($HOSTTYPE)=sun3 && ($TERM)=sun ) X11 if ($HOSTTYPE == sun3 && $TERM == sun) then X11 endif Note that aliases won't work in the one-line if statement format, you have to use the multiple-line format. This is documented quite extensively in the man page. RTFM. Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710
Re: (t)csh if query
Author: james cloos
Date: Tue, 04 Sep 1990 20:13
Date: Tue, 04 Sep 1990 20:13
9 lines
774 bytes
774 bytes
Seeing as our mail adresses here don't include the actual machine names, we are unable to cancel messages. My (Oh so ****ed obvious) errors have been pointed out to me; no more mail is required. With luck I'll remember everything else I forgot about UNIX in the last few months w/o needing to bother you-all. -JimC
Re: (t)csh if query
Author: karl_kleinpaste
Date: Tue, 04 Sep 1990 20:40
Date: Tue, 04 Sep 1990 20:40
9 lines
673 bytes
673 bytes
cloos@acsu.buffalo.edu writes: What I tried is: if ( ($HOSTTYPE)=sun3 && ($TERM)=sun ) X11 "==", not "=". Parenthesize around the whole expression, too: if (($HOSTTYPE == sun3) && ($TERM == sun)) X11 --karl
Re: (t)csh if query
Author: George Turczynski
Date: Fri, 07 Sep 1990 01:56
Date: Fri, 07 Sep 1990 01:56
25 lines
1266 bytes
1266 bytes
In article <34710@eerie.acsu.Buffalo.EDU>, cloos@acsu.buffalo.edu (james cloos) writes:
> What I tried is:
>
> if ( ($HOSTTYPE)=sun3 && ($TERM)=sun ) X11
>
As far as csh is concerned, I would try this:
if( ("$HOSTTYPE" == "sun3") && ("$TERM" == "sun") ) X11
Note the use of spaces (especially around the "==").
Also, RTFM might be helpful in the future (Reading The Friendly? Manual).
Good luck,
and have a nice day...
--
| George P. J. Turczynski. |----------------------------------------------------
| Computer Systems Engineer. | ACSnet: george@highland.oz | I can't speak for the |
| Highland Logic Pty. Ltd. | Phone: +61 48 683490 | company, I can barely |
| Suite 1, 348-354 Argyle St | Fax: +61 48 683474 | speak for myself... |
| Moss Vale. NSW. Australia. 2577 |----------------------------------------------------
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads