[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 638
  • Last Modified:

Why Do I Keep Getting "ksh" Unix errors?

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
matrix0511
Asked:
matrix0511
  • 6
  • 5
1 Solution
 
woolmilkporcCommented:
Change your login shell to bash:

chsh -s /bin/bash

and retry.
0
 
johnsoneSenior Oracle DBACommented:
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
 
matrix0511Author Commented:
All the other users use .bash_profile.  So I assume all use bash.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
matrix0511Author Commented:
@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
 
woolmilkporcCommented:
Did you log out and log in again after running chsh?
0
 
matrix0511Author Commented:
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
 
woolmilkporcCommented:
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
 
matrix0511Author Commented:
@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
 
matrix0511Author Commented:
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
 
matrix0511Author Commented:
The good news is that the alias is working in my profile now.

We just need to fix this one ORACLE_HOME issue.
0
 
woolmilkporcCommented:
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
 
woolmilkporcCommented:
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now