From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10b612,5120b503df4ed78f X-Google-Attributes: gid10b612,public X-Google-Thread: 1070f0,5120b503df4ed78f X-Google-Attributes: gid1070f0,public X-Google-Thread: 1020c6,5120b503df4ed78f X-Google-Attributes: gid1020c6,public X-Google-Thread: 11035d,5120b503df4ed78f X-Google-Attributes: gid11035d,public X-Google-Thread: 115614,5120b503df4ed78f X-Google-Attributes: gid115614,public X-Google-Thread: 1069a6,5120b503df4ed78f X-Google-Attributes: gid1069a6,public X-Google-Thread: 1164f8,5120b503df4ed78f X-Google-Attributes: gid1164f8,public X-Google-Thread: 1012a6,5120b503df4ed78f X-Google-Attributes: gid1012a6,public From: werner@farina.mc.ab.com (tim werner) Subject: Re: Portable startup files question.. Date: 1995/05/21 Message-ID: #1/1 X-Deja-AN: 103021643 distribution: inet references: to: ricky@fibronics.co.il (Ricardo Marek) organization: Allen-Bradley Company, Inc. newsgroups: comp.unix.solaris,comp.unix.ultrix,comp.unix.admin,comp.unix.shell,comp.unix.aix,comp.sys.sun.admin,comp.sys.dec,comp.s >From: ricky@fibronics.co.il (Ricardo Marek) >Date: Sun, 21 May 1995 09:55:35 GMT >How can I configure my startup files ( .cshrc, .login, .profile, >.tcshrc) in order to get arround with the differences between OS >types. (setting paths, environment vars, aliases, etc..), having also >the possibility of seting particular stuff for a certain >machine/host/OS System? > >- Using `uname` is not the short way, because SunOS and Solaris have >the same identification. This is not true. For me, "uname -r" will return "5.4" for Solaris, and "4.1.3" for SunOS, "A.09.04" for HP-UX. You can have a .profile thus: TCSH=/usr/local/bin/tcsh if test -x $TCSH ; then exec $TCSH ; fi You can put something like this in your .cshrc, in case your chsh is csh because not all the machines you log into have tcsh: if ( $?term ) then set TCSH = /usr/local/bin/tcsh if ( ! $?MYSHELL && -x $TCSH) then setenv MYSHELL $TCSH exec $TCSH -l endif endif set whatos = `uname -r | sed 's/\..*//'` if ( "$whatos" == 5 ) then # Solaris else if ( "$whatos" == 4 ) then # SunOS or Ultrix endif else # HP-UX endif YMMV hth, tw -- The shadow of the bamboo sweeps the steps, but the dust does not stir.