If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > bash shell with DB2 Linux DPF (InfoSphere Warehouse)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-09-09, 14:11
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
bash shell with DB2 Linux DPF (InfoSphere Warehouse)

DB2 InfoSphere Warehouse 9.7 on Red Hat Linux (previously known as DB2 ESE with DPF feature).

Has anyone used bash shell (default for Linux) on the instance owner when using DPF (InfoSphere Warehouse)? I notice that when I run db2_all it can't find .profile, which doesn't exist with bash shell.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 08-09-09 at 14:15.
Reply With Quote
  #2 (permalink)  
Old 08-09-09, 14:53
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
bash reads the profiles in certain sequence, starting with .bashrc, then .profile, then /etc/profile, if I remember correctly (read the bash man page to be sure). It executes the first one it finds and does not search further. I think if invoked as /bin/sh it skips .bashrc for compatibility, so you may want to try creating a symlink to bash, named sh, or create a copy of the bash executable named sh.
Reply With Quote
  #3 (permalink)  
Old 08-09-09, 15:04
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by n_i
bash reads the profiles in certain sequence, starting with .bashrc, then .profile, then /etc/profile, if I remember correctly (read the bash man page to be sure). It executes the first one it finds and does not search further. I think if invoked as /bin/sh it skips .bashrc for compatibility, so you may want to try creating a symlink to bash, named sh, or create a copy of the bash executable named sh.
That's not what I mean.

The db2_all script that comes with DB2 is a ksh script and it looks for the .profile file on the instance owner directory and can't find it. I could make a .profile file with the same info as bashrc (to invoke the db2profile), but I am also wondering if I am going to run into other problems down the road.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 08-09-09, 21:17
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I think you could either rename .bashrc to .profile, and bash will happily find it, or symlink .profile to .bashrc - this way you'll need to maintain only one file. I don't see any problems from that point of view; however, pdksh (I guess that's what you have on Red Hat) is not completely compatible with the AIX korn shell so, depending on what your script is doing, you may run into some problems. For example, getopts behaves a bit differently in functions, which I had a pleasure to discover recently.
Reply With Quote
  #5 (permalink)  
Old 08-09-09, 21:58
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I have the ksh.x86_64 package installed, not pdksh.

But at this point I need to find someone who has experience with DPF on Red Hat Linux to know for sure if this is going to work with the bash shell (with a workaround similar to what you suggested).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On