Solved

Why Do I Keep Getting "ksh" Unix errors?

Posted on 2012-04-10
12
628 Views
Last Modified: 2012-05-10
The Linux User that worksUser with the issueI have a user That was created for me on Unix server. when I login though I can't run some of the same commands that work fine under other users.

Also, none of the "alias" that I setup in my .bash_profile work when I run them. I keep getting "ksh: not found" errors. See below.

Also, when I login as other users I get the "user@servername" prompt. But when I login as this particiular user I don't get any of those prompts. See the defference below.

What am I doing wrong? I feel if I can resolve those issues everything will start working as it does for other Linux users.

Thanks
0
Comment
Question by:matrix0511
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37830035
Change your login shell to bash:

chsh -s /bin/bash

and retry.
0
 
LVL 35

Expert Comment

by:johnsone
ID: 37830041
Are the other users set up to use ksh or bash as their shell?

The first problem is that you are updating a .bash_profile.  As far as I know, ksh doesn't use .bash_profile.  It typically uses .profile.

If the other users are using ksh as their shell, I suggest copying the files from their home directories to get the same setup.
0
 

Author Comment

by:matrix0511
ID: 37830053
All the other users use .bash_profile.  So I assume all use bash.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:matrix0511
ID: 37830065
@woolmilkproc, I changed my shell but still none of my alias commands work.

Below is what my .bash_profile looks like. You will notice my alias commands. In the past I have never had a problem with my bash shell and running these commands. I  must be missing something.



 /$$      /$$ /$$$$$$$$ /$$$$$$
| $$  /$ | $$|__  $$__//$$__  $$
| $$ /$$$| $$   | $$  | $$  \__/
| $$/$$ $$ $$   | $$  |  $$$$$$
| $$$$_  $$$$   | $$   \____  $$
| $$$/ \  $$$   | $$   /$$  \ $$
| $$/   \  $$   | $$  |  $$$$$$/
|__/     \__/   |__/   \______/


Official WTS use only
Contact syseng for more information


$
Changing shell for jde910.
Password:
Shell changed.
$
$ ll
total 4
lrwxrwxrwx 1 jde910 jde910   20 Apr  5 22:07 ODesktop -> /home/oracle/Desktop
drwxr-xr-x 3 jde910 jde910 4096 Apr  8 13:12 oradiag_jde910
$ e1
-ksh: e1: not found [No such file or directory]
$ vi .bash_profile
fi

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
     . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
ORAENV_ASK=NO
. oraenv
ORAENV_ASK=YES

ORACLE_HOME=/u01/app/oracle/product/11.2.0/client_1
export ORACLE_HOME
export ORACLE_SID=demo
export PATH=$ORACLE_HOME/bin:$PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin

umask 022

if [ -f /u01/jdedwardsppack/e910/SharedScripts/enterpriseone.sh ]; then
. /u01/jdedwardsppack/e910/SharedScripts/enterpriseone.sh
fi

alias ora="cd /u01/app/oracle/product/11.2.0/client_1"
alias app="cd /u01/app"
alias e1="cd /u01/jdedwardsppack/e910"
alias sys="cd /u01/jdedwardsppack/e910/system/bin32"
alias ll="ls -al"
alias pro="vi .bash_profile"
                                                                                        43,1          90%
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37830075
Did you log out and log in again after running chsh?
0
 

Author Comment

by:matrix0511
ID: 37830106
Ok. Well, after I logged out and back in it now prompts me for the ORACLE_HOME. Does this mean that all the changes made to my .bash_profile are gone??

login as: jde910
Using keyboard-interactive authentication.
Password:
Last login: Tue Apr 10 14:09:40 2012 from 10.188.30.203
 /$$      /$$ /$$$$$$$$ /$$$$$$
| $$  /$ | $$|__  $$__//$$__  $$
| $$ /$$$| $$   | $$  | $$  \__/
| $$/$$ $$ $$   | $$  |  $$$$$$
| $$$$_  $$$$   | $$   \____  $$
| $$$/ \  $$$   | $$   /$$  \ $$
| $$/   \  $$   | $$  |  $$$$$$/
|__/     \__/   |__/   \______/


Official WTS use only
Contact syseng for more information


ORACLE_HOME = [/home/oracle] ?
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37830129
Au contraire.

The question you're asked comes from this part of your .bash_profile

ORAENV_ASK=YES

which obviously indicates that this profile gets executed and that this file

oraenv

does not exist in your $HOME.
0
 

Author Comment

by:matrix0511
ID: 37830138
@woolmilkporc, so what do I need to do now to resolve this so that it won't keep prompting me for the ORACLE_HOME? It never did that when I was using the other shell. Even if I put in the oracle home when I log out and back in it still prompts me again.
0
 

Author Comment

by:matrix0511
ID: 37830148
This is what it keeps giving me:

ORACLE_HOME = [/home/oracle] ?
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID jde910.
You can set ORACLE_BASE manually if it is required.
[jde910@tk0089es01 ~]$
0
 

Author Comment

by:matrix0511
ID: 37830157
The good news is that the alias is working in my profile now.

We just need to fix this one ORACLE_HOME issue.
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 37830248
Normally ORAENV_ASK must be exported.
I'm really unsure why that's not done in your profile.

So, as a first little measure change

ORAENV_ASK=NO
to
export ORAENV_ASK=NO

and check your home directory for a file called "oraenv":

cd $HOME
ls -l oraenv

If the file is not found try to copy this file from another user's $HOME.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37831384
OK,

I just looked again at your profile and realized that ORACLE_SID is set after the call to oraenv, which is wrong.

With ORAENV_ASK=NO ORACLE_SID must be set before calling oraenv, otherwise you will always be asked for ORACLE_HOME.

So please move this statement

export ORACLE_SID=demo

just between

export PATH
and
ORAENV_ASK=NO

You can also move the whole ORACLE... block there, from

ORACLE_HOME=/u01/app/oracle/product/11.2.0/client_1
to
export TNS_ADMIN=$ORACLE_HOME/network/admin


If all of the users' profiles look the same as the one you posted, but other users are not asked for ORACLE_HOME then for these users ORACLE SID must have been set elsewhere beforehand, perhaps in " . ~/.bashrc".
Is this file present in your $HOME?

wmp
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question