csh in solaris


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting csh in solaris
# 1  
Old 09-02-2008
csh in solaris

how can i pre-set then PATH so that i no need setenv everytime i login.

i know it can be done with edit .login on normal user
but how about root?
# 2  
Old 09-02-2008
There are two type of startup-files:
- user depending in home-dir of user (e.g. $HOME/.profile)
- system-wide (valid for all users) (e.g. /etc/profile)

user depending login-startup files (like .login, .profile) are stored in the users home directory.
Also user root has defined a home dir (usually /):

Code:
more /etc/passwd | grep root
root:x:0:1:Super-User:/:/sbin/sh

--> in this case the home-dir of root is /

In which login-startup file you add the setting of the environment variable is very much depending on the login shell your user is using.
In the above example, root is using /sbin/sh as login shell.
For the bourne-shell (sh) the correct login-startup file is /.profile if only user root should use this file for startup or /etc/profile if all users should use this startup file.

Code:
sequence of startup-files for

sh, ksh, bash: 1. /etc/profile, 2.$HOME/.profile

csh: 1. /etc/.login, 2. $HOME/.cshrc, 3. $HOME/.login

tcsh: 1. /etc/csh.cshrc, 2. /etc/csh.login, 3. $HOME/.cshrc, 4. $HOME/.login

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Nice syntax in csh on Solaris 10

Dear Solaris Experts, I would like to set the lowest priority when running a resource intensive program in C shell on Solaris 10 similar to the following syntax that works in Korn shell: $ nice -n 19 programHowever, I got the following error when running the same command in C shell: 9 ... (3 Replies)
Discussion started by: gjackson123
3 Replies

2. Shell Programming and Scripting

What does this do in CSH?

CSH experts What does the following do in CSH? :(){:|:&};: I was asked the question, but I don't know. I'm not aware of the context. Any ideas? Thanks! (1 Reply)
Discussion started by: wallg
1 Replies

3. Shell Programming and Scripting

.sh to .csh

Hi All, Could any one of you give me a hand to convert the following line of codes from .sh to .csh please ? proc_id=`fuser /tmp/test` if then echo "File is not being used by any thing" fi if then echo "File is being used... please wait" sleep 1 fi Regards. (1 Reply)
Discussion started by: sraj142
1 Replies

4. UNIX for Dummies Questions & Answers

Csh script

Hey all, I've only just started using UNIX coding on my Masters project, so am still learning!! The script I've been writing is literally just for me to get used to writing it and seeing what I can do with some data I've been given. I'm trying to write a script, where the penultimate line... (2 Replies)
Discussion started by: southernlight
2 Replies

5. Shell Programming and Scripting

Using \n in csh

I am trying to use \n for a new line in csh like this echo "some text\n" echo "some more text\n" but am getting some text\n some more text\n (10 Replies)
Discussion started by: kristinu
10 Replies

6. Shell Programming and Scripting

if in csh

I am using this code echo "opt_tpath = $opt_tpath" if ($opt_tpath == 1) echo " -tpath = $Atpath\n" and is giving opt_tpath = 0 Atpath: Undefined variable. Atpath should only be printed in opt_tpath == 1 but it still tries to print. ---------- Post updated at 10:05 AM ----------... (1 Reply)
Discussion started by: kristinu
1 Replies

7. Shell Programming and Scripting

Is tcsh 100% compatible with the plain-old csh [on Solaris 9]

Hi folks There are about 200 csh scripts (I didn't wrote them). Do all those scripts run with tcsh without modification? Is tcsh 100% compatible with the plain-old csh? $ which csh /usr/bin/csh $ which tcsh /usr/bin/tcsh $ uname -a SunOS purzelse 5.9 Generic_117171-07 sun4u sparc... (2 Replies)
Discussion started by: slashdotweenie
2 Replies

8. UNIX for Dummies Questions & Answers

csh

what is a .csh extension? there is a command line: mkaphed_ctio.csh Does anyone know what this is? :confused::confused::confused: (1 Reply)
Discussion started by: cosmologist
1 Replies

9. Shell Programming and Scripting

simple CSH Script behaves differently on Solaris and RedHat Linux

I have a simple csh-script on a Solaris Workstaion which invokes the bc calculator: #!/bin/csh set shz=2 set zshift=5 set shzp=`bc -l <<END \ scale = 3 \ -1. * $shz + $zshift \ END` echo $shzp The result ($shzp) in this case is 3 (-1*2+5). It works fine on Solaris 8. ... (2 Replies)
Discussion started by: two reelers
2 Replies

10. Shell Programming and Scripting

csh failing to call an 2 embedded csh script

I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them) Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Discussion started by: pollsizer
1 Replies
Login or Register to Ask a Question