Visit Our UNIX and Linux User Community


bash: one advantage of the ability to look for either synonym?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bash: one advantage of the ability to look for either synonym?
# 1  
Old 07-30-2009
bash: one advantage of the ability to look for either synonym?

Hi
I'm reading <learning the bash shell>. And in the section - 3.1. The .bash_profile, .bash_logout, and .bashrc Files
Code:
bash allows two synonyms for .bash_profile: .bash_login, derived from the C
 shell's file named .login, and .profile, derived from the Bourne shell and Korn
 shell files named .profile. Only one of these three is read when you log in. If 
.bash_profile doesn't exist in your home directory, then bash will look for 
.bash_login. If that doesn't exist it will look for .profile.

One advantage of bash's ability to look for either synonym is that you can 
retain your .profile if you have been using the Bourne shell. If you need to 
add bash-specific commands, you can put them in .bash_profile followed by 
the command source .profile. When you log in, all the bash-specific 
commands will be executed, and bash will source .profile, executing the 
remaining commands. If you decide to switch to using the Bourne shell you 
don't have to modify your existing files. A similar approach was intended for 
.bash_login and the C shell .login, but due to differences in the basic syntax
 of the shells, this is not a good idea.

I'm confused about what the author says about the "advantage". To "source" Bourne shell's .profile in the bash's .bash_profile can only prove that bash is backward-compatible with Bourne shell. It has nothing to do with its ability to look for either synonym. Why does the author think it is an advantage of bash's ability to look for either synonym? This does not make sense at all.
# 2  
Old 07-30-2009
When you run/develop in an environment with multiple shells it is useful.

Older shells allow only one init file. The author is speaking of portability mostly.

Previous Thread | Next Thread
Test Your Knowledge in Computers #300
Difficulty: Easy
The basis for the first versions of the Slackware Linux distributions was Debian Linux.
True or False?

8 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Ability to use vSphere client to monitor guest VMs on my laptop

Hi guys. I'm a newbie to VMs. What I want to achieve is that I create VMs on my laptop that I can monitor and access using vSphere client. I am using an Acer laptop with intel processor. Which hypervisor will i need ? How do I need to install it ? Is these any free solution ? ... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

2. UNIX for Dummies Questions & Answers

Create user with sudo ability to root.

Hi All, I need to give an user sudo ability to root. We have also generated RSA key but unable to proceed further. For example after a user logs into the server normally and when he executes below command $ssh root@server_name This should take you to root prompt # Please help me.... (3 Replies)
Discussion started by: Rockyc3400
3 Replies

3. Red Hat

Cobbler - what is the advantage?

Hi guys, new user here, so please be gentle. I need to build a lot of servers at work on a weekly basis with various versions of RH and additional applications. We use PXE/Kickstart to do this with selections made from a simple menu structure. However, I keep hearing about Cobbler and... (0 Replies)
Discussion started by: hankpym
0 Replies

4. UNIX for Advanced & Expert Users

What files or programs have the ability to change your default network scripts and config

What files or programs have the ability to change your default network scripts and config files? All 3 of these very important files got changed on their own. /etc/sysconfig/network-scripts/ifcfg-wlan0 /etc/sysconfig/networking/devices/ifcfg-wlan0... (4 Replies)
Discussion started by: cokedude
4 Replies

5. UNIX for Dummies Questions & Answers

what is the advantage of unix sockets?

Hi, i understood that there are several type of sockets: TCP, UDP & Unix. i wondered, what is the performance advantages of unix socket of the other types? isn't it equal to use UDP with localhost as destination over unix socket? Thanks in advance, Sariel (1 Reply)
Discussion started by: sarielz
1 Replies

6. Shell Programming and Scripting

Ability to run sas prog on remote server using SSH

Hi, I am trying to run a sas prog on a remote server using ssh. I have got the command that I am using in the below paragraph. With it, I was able to run shell scripts but when I tried 'sas' it errored out. I have got my keys exchanged so when I say ssh serverA I automatically connect to my... (4 Replies)
Discussion started by: coolavi
4 Replies

7. Shell Programming and Scripting

Ability to store number of rows

Hi, I am creating a korn shell script and i'm trying to find out what the total number of rows are in a specific text file and i need to store that number in a variable withing the script. i know wc -l gives you the number, but it also has some leading spaces and then writes out the file name... (2 Replies)
Discussion started by: scabral
2 Replies

8. Shell Programming and Scripting

Load Oracle tables and switch public synonym

I need some help from Oracle and UNIX expertise point of view. I have two tables, METADATA_A and METADATA_B. I need to switch loading these tables. If we load METADATA_A today, the following week we would have to load METADATA_B. There is a public synonym "METADATA" that sits on top of... (2 Replies)
Discussion started by: madhunk
2 Replies

Featured Tech Videos