Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Understanding the difference between individual BASH login scripts Post 303006906 by apmcd47 on Thursday 9th of November 2017 04:19:46 AM
Old 11-09-2017
The profile and login files are for setting your non-volatile environment. For instance, any environment variables, such as PATH, that you export. So these variables will stay with you from shell to subshell to subshell. In the olden days, when people logged in from a terminal, commands like stty would also appear in the login files, because no matter how many subshells you start, you won't change your terminal.

The basrc/kshrc and rc files for other shells are for the volatile environment, such as functions and aliases, which don't stay with you when you start a subshell, or variables that you don't for some reason export.

Before somebody corrects me, I should say that functions can be exported in bash (and I think ksh), but they don't tend to be.

Andrew

---------- Post updated at 09:19 AM ---------- Previous update was at 09:07 AM ----------

Quote:
Originally Posted by bodisha

I looked through the profile and all the scripts under the /etc/profile.d directory and couldn't locate anything calling the /etc/bashrc script. Could I ask you for a clue on where else I might look to see what's starting it?

Thanks for your patience
From the bash man page on my Ubuntu system:
Code:
       --init-file file
       --rcfile file
              Execute commands from file instead of the system  wide  initial‐
              ization file /etc/bash.bashrc and the standard personal initial‐
              ization file ~/.bashrc if the shell is interactive (see  INVOCA‐
              TION below).

If you have /etc/bashrc it is possible that your distribution has changed the name of the default system bashrc file (or maybe Ubuntu or Debian have). But this file is read by bash by default on startup.

Andrew
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Difference in Shell Scripts

Hi, Is anyone can help me to find out the difference in Shell Scripts between HP and Sun. Thanks in advance, Vijay R (3 Replies)
Discussion started by: rv_kumar
3 Replies

2. UNIX for Dummies Questions & Answers

Understanding System Vish startup scripts

I'm trying to get a clear picture of how startup scripts are executed during bootup. When run-level N is entered, the scripts in /rcN.d are executed. I understand that the S* scripts are executed in numerical order during bootup. What I don't understand is if the K* scripts are executed... (0 Replies)
Discussion started by: darkmatter14B
0 Replies

3. Shell Programming and Scripting

Need help on understanding the Shell and AWK scripts

Hello Friends, I am new to the scripting & have to analyze bunch of regular production scripts. It has .ksh which calls on the .awk script having many functions I need to understand and debug the scripts ASAP Can anybody please let me know as how can I debug, I want to see the flow of code... (3 Replies)
Discussion started by: amberj123
3 Replies

4. Shell Programming and Scripting

Difference between calling the sub scripts

What is the difference between calling the sub scripts of below two line. /home/scripts/devdb.sh . /home/scripts/devdb.sh sh /home/scripts/devdb.sh We are using the suse 2.0 version (4 Replies)
Discussion started by: kingganesh04
4 Replies

5. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

6. Shell Programming and Scripting

Need a better understanding of shell scripts

Need a better understanding of shell scripts (14 Replies)
Discussion started by: sureshkumar4737
14 Replies

7. IP Networking

Help understanding iproute2 and tc scripts

Hi all, I am new to linux routing and would like to keep a possible running dialog about some scripts I have been studying and what the different parts of them mean. We are using Openwrt backfire along with openvpn and Swyx as VoIP. My goal is to eventually implement some QoS using dsmark, but... (1 Reply)
Discussion started by: shodg001
1 Replies

8. Shell Programming and Scripting

Difference between kshell and bash shell scripts Example cited

Hi All, I need some urgent help regarding some info. I have a cluster of servers for which I have two scripts for management. control.sh is a bash script meant for restarting/stopping the servers. manger.ksh is a kshell script. It is a master script to manage restarting/stoppping and... (3 Replies)
Discussion started by: ankur328
3 Replies

9. Solaris

Individual usernames for the same login account

Hi There is an application installed on a server, that has a unique login account, but many users are using it with the same login name! How can we overcame this by creating individual accounts for the same application login account? (11 Replies)
Discussion started by: fretagi
11 Replies

10. UNIX for Dummies Questions & Answers

Understanding bash code

I am not able to understand below line in unix bash shell.Could anyone explain what it will do result="${path1}/*${var1}*${var2}*wssreligibleitem*.csv" path1 is defined and it is a directory path var1 is defined and it holds string value like abc var2 is defined and it holds string value like... (6 Replies)
Discussion started by: vamsi.valiveti
6 Replies
CHSH(1) 							   User Commands							   CHSH(1)

NAME
chsh - change login shell SYNOPSIS
chsh [options] [LOGIN] DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account. OPTIONS
The options which apply to the chsh command are: -h, --help Display help message and exit. -s, --shell SHELL The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks. NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. FILES
/etc/passwd User account information. /etc/shells List of valid login shells. /etc/login.defs Shadow password suite configuration. SEE ALSO
chfn(1), login.defs(5), passwd(5). User Commands 06/24/2011 CHSH(1)
All times are GMT -4. The time now is 03:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy