Sponsored Content
Full Discussion: Customizing bash on AIX
Top Forums UNIX for Advanced & Expert Users Customizing bash on AIX Post 303037203 by bakunin on Thursday 25th of July 2019 02:10:37 PM
Old 07-25-2019
First off: AIX is not a "distro" it is its own UNIX, with its own kernel, etc.. This is NOT "some other kind of Linux", it is not Linux at all. Notice that AIX uses a Korn Shell as its native shell. If you want to use bash as a login shell you not only have to install it but also add it to the list of allowed shells in (IIRC - have no AIX system at hand to verify) /etc/security/login.defs

As an AIX administrator for the last 25 years i suggest NOT to use the bash at all - at least not for administration purposes! Subtle differences between ksh and bash might come to bite you and error analysis is difficult enough without adding complexity to the system. By the way, ksh is also the better shell, IMHO, but that is a different topic.

In case i cannot convince you to stay away from bash:

You should NOT put what you wrote in .profile but in .bashrc. First, .profile is executed whenever you log on, not whenever you start a shell. But you want an RC script to be run whenever a shell starts, be it a login shell or a second, third, ... instance, no? Exactly this is done with an rc-script. Most people want a consistent environment whenever they start a new shell.

Furthermore, if you place configuration commands in .profile they would be executed by any login shell. So, if you change the login shell to ksh, it would be fed bash-commands and you probably would not want that either. Put this line:

Code:
export ENV=/path/to/shell-configuration-file

into your profile. This tells the login process, which starts our login shell to run exactly this rc-script. It should (for most purposes) be the normal rc-script for your shell, so either (for ksh):

Code:
export ENV=~/.kshrc

or (for bash)

Code:
export ENV=~/.bashrc

Notice that the file needs to be flagged executable. Here is a little trick, btw.: always set the PATH completely in the rc-script. My setting usually looks like:

Code:
export PATH="/usr/bin"
       PATH="$PATH:/usr/local/bin"
       PATH="$PATH:$HOME/bin"
       ....

Most people only add pathes and usually end up with i.e. /usr/local/bin five times in their path. You can avoid that with my method because the first line not only sets the first path but also clears it, so at the end it is always set in the same way, regardless of how many shell instances i open.

I hope this helps.

bakunin

Last edited by bakunin; 07-25-2019 at 03:16 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

customizing xterm windows

Does anyone now how to customize an xterm window in solaris to dynamically 'pwd' in the banner. I know how to launch with xterm -n 'cwd' but it does not change when I change dir's. (4 Replies)
Discussion started by: toddy44
4 Replies

2. UNIX for Dummies Questions & Answers

Customizing CDE background

i have a question about setting the background in a workspace in CDE. I have CDE runnning on Solaris 8 here at work and I want to use some images I have as the background in or two of the workspaces. When I use xv on the image and choose the option the option from the Display Menu -> Root:... (1 Reply)
Discussion started by: Kanu77
1 Replies

3. Shell Programming and Scripting

customizing desktop

I need help editing my openwin file. I've got it all set up so the options I normally use (xman, cmdtools, xeyes, printtool) automatically come up when I log on, but it won't read my -geometry entries. I got them by right-clicking on the desktop, but apparently they need to be entered a certain... (0 Replies)
Discussion started by: sdienlin
0 Replies

4. Red Hat

Customizing RHEL OS

Hello Every One, I am not sure if this is the correct forum to post this question. But please help me with your ideas. I have got a work (proj) where i need to customize the RHEL OS . This would involve building packages, installing them , correcting privileges etc and all these... (4 Replies)
Discussion started by: shirsha
4 Replies

5. UNIX for Dummies Questions & Answers

Customizing UNIX

Hello i'm just wondering how to customize the color of unix's (or SSH) background, cursor, and letter? Thank you for your time (4 Replies)
Discussion started by: mgyeah
4 Replies

6. UNIX for Dummies Questions & Answers

Customizing from address in mailx command

Currently I am using mailx command for sending mails. But the mail is sent as from userid@servername by default. Is it possible to customise the from mail address in mailx command? Thanks (2 Replies)
Discussion started by: pandeesh
2 Replies

7. UNIX for Dummies Questions & Answers

customizing default file permission

By default, the files are creates with this permissions:-rw-rw-r-- Is it possible to customize that in such away that ,always created as 777. Where i need to make changes? Please guide me. Thanks (2 Replies)
Discussion started by: pandeesh
2 Replies

8. Shell Programming and Scripting

Customizing ps command

Hi, I want to monitor our batch jobs at a specific interval for later analysis to see the performance and CPU utilization USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND ps aux|grep dsadm|head xxxxx 386 0.0 0.0 103524 15448 pts/0 S Mar27 0:00... (6 Replies)
Discussion started by: ratheeshjulk
6 Replies

9. Red Hat

RHEL6 customizing prompt do not work

Hi, I'm trying to customize the ksh prompt for users on a RHEL 6.6 system for having user@host pwd : $ and user@host pwd # in red color for root. I think it's possible but i do not even succeded for a non root user : I added in my ~/.kshrc : PS1="Hello : " and it works but when i... (4 Replies)
Discussion started by: Fundix
4 Replies
All times are GMT -4. The time now is 07:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy