Solved

Why Do I Keep Getting "ksh" Unix errors?

Posted on 2012-04-10
12
613 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
ID: 37830035
Change your login shell to bash:

chsh -s /bin/bash

and retry.
0
 
LVL 34

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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Choosing CentOS 16 82
linux redhat 7.2 10 74
SonarQube on Linux vs Windows 3 28
open source backup solution 1 29
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

803 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