?
Solved

Why Do I Keep Getting "ksh" Unix errors?

Posted on 2012-04-10
12
Medium Priority
?
632 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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 1500 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

770 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