Explaining some lines from files : .login and .cshrc


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Explaining some lines from files : .login and .cshrc
# 1  
Old 01-12-2012
Explaining some lines from files : .login and .cshrc

Hello, can anyone explain me please what do those lines do ?

From file .login

1) set history=40
2) setenv MACH `uname -s`
3) source /etc/login
4) source ~/$MACH/.login

From file .cshrc

1) if ( ! $?prompt) exit 0
# 2  
Old 01-12-2012
The .cshrc example is checking whether you are in background (and therefore with no terminal context) and avoiding executing subsequent commands which need a terminal.

The lines from ".login" are easy to look up.
This User Gave Thanks to methyl For This Post:
# 3  
Old 01-12-2012
history remembers the most recent events done on the command line set history=40

---------- Post updated at 07:14 PM ---------- Previous update was at 07:08 PM ----------

For actions for the user to be performed only once upon login, you have a line "source /etc/login" at the top of every user's $HOME/.login
This User Gave Thanks to kristinu For This Post:
# 4  
Old 01-13-2012
Thank you all for Your help, I almost got everything expect one :

"setenv MACH `uname -s`"
# 5  
Old 01-13-2012
The setenv command alters the environment (standard settings) of the program. The environment contains parameters for the commands that the user does not want to specify every time a command is used.

For example, if you want to define a short name for a particular directory:
Code:
setenv PS $HOME/docs/postscript

allows you subsequently to refer to the subdirectory called postscript as $PS

uname (short for unix name) is a software program in Unix and Unix-like computer operating systems that prints the name, version and other details about the current machine and the operating system running on it.
# 6  
Old 01-13-2012
Quote:
setenv MACH `uname -s`
This returns basic machine Operating System (e.g. HP-UX). Try it on your system(s).
Line 4) then uses the value of $MACH to "source" a suitable additional ".login" file for this Operating System.
It's a clever way to have a central common ".login" file which you can proliferate to multiple accounts on multiple computers.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

Help in explaining this echo conundrum.

OSX 10.12.3, default bash terminal. Consider this code and note it is calling 'sh' inside the code... #!/bin/sh echo '1\n2\n2\n3\n5' > /tmp/text hexdump -C /tmp/text /bin/echo '1\n2\n3\n4\n5' > /tmp/text hexdump -C /tmp/text Now view the interactive mode below, note the underlying shell is... (6 Replies)
Discussion started by: wisecracker
6 Replies

2. Shell Programming and Scripting

Help to explaining a command in run dot tcl

Hi, I'm running a rdt (run dot tcl) command, and come accross this line: alias abc 'set ARGS =(\!*); source home123/abc/$ARGS/setup' What does the command exactly do? Please help. (6 Replies)
Discussion started by: mar85
6 Replies

3. UNIX for Dummies Questions & Answers

Need help explaining how to use a VPN on a UNIX server with a Mac OS

I have gotten a gig to teach someone how to use a VPN client for a UNIX server on a MAC os. The problem is I have never used UNIX, dont mess with VPN's (my dad has a VPN that I have used a couple of times). I'm currently taking a crash course on UNIX but I was wondering if anyone could help me with... (0 Replies)
Discussion started by: psycopuppy
0 Replies

4. UNIX for Dummies Questions & Answers

explaining awk

i am new to awk scripting. i couldn't figure out how this awk script works can anyone explain? #!/bin/awk -f { for( x=1; x<=NF; ++x) { if( x == 3 ) { continue } print x, $x } } thank you and regards (1 Reply)
Discussion started by: phone_book
1 Replies

5. Shell Programming and Scripting

diffrence between .cshrc .login .profile

Hi.. i was just looking to know the diffrence between this three terms 1) .cshrc 2) .login 3) .profle but iam failed to findout the exact diffrent Please can any one share the diffrence between this regards Syed (1 Reply)
Discussion started by: smuqtaderali
1 Replies

6. UNIX and Linux Applications

diffrence between .cshrc .login .profile

Dear experts ... Please any one can describe the diffrence between this three 1) . cshrc 2) .profile 3) .login cheers syed (1 Reply)
Discussion started by: smuqtaderali
1 Replies

7. UNIX for Dummies Questions & Answers

Clarification on .cshrc,.exrc,.login,.profile,.sh_history files

All, I had a request to delete filed under a directory that was 35 days old . And they asked me to scedule it in CRON . I have done that . I have use find and delete with mtime to perfrom this task . But my script is not deleting this .cshrc,.exrc,.login,.profile,.sh_history file... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

8. UNIX for Advanced & Expert Users

.cshrc and .login overwritten !!

Hi, My account is : abcd I belong to a group: pqrs Some thing straneg happened yesterday. My .cshrc and .login got overwritten into pqrs's .cshrc and .login I obviously did not explicitly overwrite pqrs's .cshrc. Are there any reasons how this could have happened indirectly due to... (5 Replies)
Discussion started by: gjthomas
5 Replies

9. Shell Programming and Scripting

cshrc

where are my .cshrc files ? (4 Replies)
Discussion started by: cubicle^dweller
4 Replies

10. UNIX for Dummies Questions & Answers

why i have local.profile, local.cshrc,local.login instead of .profile, .login ?

Hello again ! Thanks for response of my first question. there is my second quesiton why i have local.profile instead of .profile file ? my all files in pwd shoes local. before any file. is anybody can tell me about that ? Thanks Abid Malik (5 Replies)
Discussion started by: abidmalik
5 Replies
Login or Register to Ask a Question