- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: problem with kshrc
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2005 05:48 PM
07-10-2005 05:48 PM
Iam facing a problem with .kshrc
I have a NIS setup here and there are
hpux and linux sytems in the setup
The problem is the the ailases I have mentioned in .kshrc file will be executed in hpux but not in redhat linux ...
Can anybody throw some light init this
This .kshrc file is in the /home/.profile
Thanks
Binu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2005 06:05 PM
07-10-2005 06:05 PM
Re: problem with kshrc
And the dumb question, the user you are logging in as has '/bin/ksh' as it's shell, yes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2005 07:28 PM
07-10-2005 07:28 PM
Re: problem with kshrc
The login looks like this
maheshag:u2QnKE1LLp7k2:392:20:Mahesha Guttahali(Latha's team member):/home/maheshag:/sbin/sh
in Hpux
r-xr-xr-x 1 bin bin 401408 Apr 14 2002 sh
ps give the out put
; ps
PID TTY TIME COMMAND
14318 pts/23 0:00 sh
14348 pts/23 0:00 ps
14094 pts/23 0:00 ksh
in Linux
lrwxrwxrwx 1 root root 12 Feb 17 11:00 sh -> /usr/bin/ksh
Thanks
Binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2005 07:42 PM
07-10-2005 07:42 PM
Re: problem with kshrc
Lets start with this.
NEVER LINK 'sh' TO ANYTHING OTHER THAN 'bash' ON A Linux BOX!
If you want a user to use 'ksh' as their login shell, then make the user's shell 'ksh'!
Quite a number of scripts written on a Linux box are written expecting bash functionality! 'ksh' doesn't work in the same manner as 'bash', so some unexpected things WILL happen.
Now, all that said. On a RH box by default, a '~/.kshrc' won't be called.
So this goes back to my previous question, how are you calling your '.kshrc' from your '.profile'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2005 07:49 PM
07-10-2005 07:49 PM
Re: problem with kshrc
Though my shell is sh ..I dont have any clue from where this .kshrc is been taken
It was a working setup in Hp ux and I never bothered ..
I have checked my .profile and nothing much
Can you pleae let me know where to check
Thanks
Binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2005 07:55 PM
07-10-2005 07:55 PM
SolutionIn the user's profile (or possibly the '/etc/profile'), a section that says something like this is required:
if [ "$SHELL" = "/bin/ksh" ]
then
[ -f "~/.kshrc" ] && . ~/.kshrc
fi
This will execute a '~/.kshrc' if it exists, and the shell is 'ksh'. Using the '.' method of execution means that any environment changes which occur in the '.kshrc' is within the shell's scope, and will stay there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2005 08:09 PM
07-10-2005 08:09 PM
Re: problem with kshrc
I have copied .kshrc to bashrc and set the
enviromnet in the .profile and it seems to be working
export ENV=$HOME/.bashrc
Thanks for making me think
Thanks
Binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 02:55 PM
07-11-2005 02:55 PM
Re: problem with kshrc
I have copied .kshrc to bashrc and set the
enviromnet in the .profile and it seems to be working
export ENV=$HOME/.bashrc
Thanks for making me think
Thanks
Binu