Solved

Why Do I Keep Getting "ksh" Unix errors?

Posted on 2012-04-10
12
603 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
  • 6
  • 5
12 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
Change your login shell to bash:

chsh -s /bin/bash

and retry.
0
 
LVL 34

Expert Comment

by:johnsone
Comment Utility
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
Comment Utility
All the other users use .bash_profile.  So I assume all use bash.
0
 

Author Comment

by:matrix0511
Comment Utility
@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
Comment Utility
Did you log out and log in again after running chsh?
0
 

Author Comment

by:matrix0511
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
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
Comment Utility
@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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now