Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Understanding the difference between individual BASH login scripts Post 303006893 by bodisha on Wednesday 8th of November 2017 06:18:58 PM
Old 11-08-2017
Quote:
Originally Posted by Corona688
First off, these files are shell scripts, so they do whatever their author wanted. This is responsible for a lot of the confusion - /etc/bashrc is not a file bash will load unless something else tells it to, but someone could easily have put . /etc/bashrc into /etc/profile for the same effect. You have to read these profile scripts to see what they do, no other way to know.
Thanks for the quick reply! I'm still unclear on a few points and I hope you don't mind a follow up question to straighten me out

To address your first comment about "they do whatever their author wanted"... When inspecting the files in question I noticed the comment "Functions and aliases go in /etc/bashrc" in the /etc/profile file

Based on some of the posts I've read while researching the subject... I got the impression certain files had very specific purposes... And I've even seen posts were people were saying builtin commands (like umask) wouldn't work in certain files... Can you confirm this? If so I'm trying to understand the exact rules surrounding which sort of functionality the individual startup files can support

The second part of your comment I'd like to address is you said

"/etc/bashrc is not a file bash will load unless something else tells it to, but someone could easily have put /etc/bashrc into /etc/profile"

While trying to understand this topic I edited each file and put echo commands in the individual files to see when they'd start. The /etc/bashrc started in both login and non-login shells. It loaded after the /etc/profile in a login shell (putty) and in the non-login shell (The gnome GUI terminal) when the /etc/profile didn't run.

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
 

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. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -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). shadow-utils 4.5 01/25/2018 CHSH(1)
All times are GMT -4. The time now is 12:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy