.profile not reading .kshrc


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting .profile not reading .kshrc
# 1  
Old 03-05-2007
.profile not reading .kshrc

Can anyone tell me why .profile would not be reading my .kshrc file?

O/S is SCO 5.06? I've placed echo's before & after setting ENV and
nothing ... help?

Thanks!


Here's .profile

==================================================
:
# DoubleVision Pro's digiboard call during login...
[ -x /usr/lib/dv/digi_trigger ] && /usr/lib/dv/digi_trigger
# @(#) root.profile 88.2 99/12/21
#
# Copyright (C) 1989-1999 The Santa Cruz Operation, Inc.
# All Rights Reserved.
# The information in this file is provided for the exclusive use of
# the licensees of The Santa Cruz Operation, Inc. Such users have the
# right to use, modify, and incorporate this code into other products
# for purposes authorized by the license agreement provided they include
# this notice and the associated copyright notice with any such product.
# The information in this file is provided "AS IS" without warranty.
#

SHELL=/bin/ksh
HOME=/usr/space
PATH=$PATH:/etc:/tcb/bin
PFPRINTER=hp_accting
PFPROG=/u/appl
PFDATA=/u
PFDIR=/appl
export PFPRINTER PFPROG PFDATA PFDIR
# set terminal type
# eval `tset -m scoansi:${TERM:-scoansi} -m :\?${TERM:-scoansi} -e -r -s -Q`
export TERM PATH SHELL HOME
[ -x /bin/termtype ] && /bin/termtype

[ -x /bin/mesg ] && mesg n # if mesg is installed...

echo "$HOME/.kshrc"

if [ -f $HOME/.kshrc -a -r $HOME/.kshrc ]; then
ENV='${_ENVFILE[(_=1)+(_$-=0)-_${-%%*i*}]}'
_ENVFILE=/.kshrc
export ENV _ENVFILE
fi

uptime
echo " "
dfspace
echo " "
cat /etc/motd
echo

==========================================================
And here's the .kshrc file

#!/bin/ksh
# @(#) root.kshrc 88.2 99/12/21
#
# Copyright (C) 1989-1999 The Santa Cruz Operation, Inc.
# All Rights Reserved.

export SHELL=/bin/ksh

# set vi mode (Arrow fnkys not supported in this mode) when ksh
# interactive and VISUAL|EDITOR contain "vi" or vi mode already set.
# Setup support for (ansi) arrow fnkeys (and emacs mode) when ksh interactive
# and VISUAL|EDITOR not contain vi and vi mode not set or emacs mode is.
# Don't do any of this if $_noAUTOFNKEYS is set to anything.
if [[ -z "$_noAUTOFNKEYS" ]] ; then
em=${VISUAL:-EDITOR}
[[ -o vi ]] && em=vi
[[ -o emacs ]] && em=emacs
[[ -o gmacs ]] && em=off
em=${em:-"emacs"}
# echo "$-:${em}"
case "$-:${em}" in
*i*: off) ;;
*i*:*vi* )
# echo "** ksh -o vi (interactive)"
set -o vi
;;
*i* )
# echo "** ksh -o emacs (interactive)"
set -o emacs
# Ansi (console/scoterm/xterm) Fnkey sequences
alias __A='^P' # UpArr
alias __B='^N' # DwnArr
alias __C='^F' # RghtArr
alias __D='^B' # LftArr
alias __H='^A' # Home
alias __F='^E' # End
_TAB_Complete=1 # enable Tab completion as well as Esc,Esc
;;
esac
fi

alias mc='cd `mc -caP`'
alias mcedit='mcedit -ca'
export PS1="SCO_SV:\$PWD # "

Last edited by gseyforth; 03-05-2007 at 03:46 PM..
# 2  
Old 03-05-2007
First I would check permissions of the .kshrc file to make sure it can be executed
Second. why don't you call the .kshrc file in the .profile with
. .kshrc
# 3  
Old 03-05-2007
Quote:
Originally Posted by moshe fried
First I would check permissions of the .kshrc file to make sure it can be executed
Second. why don't you call the .kshrc file in the .profile with
. .kshrc

Thanks ...

Looked at that ... perms are set correctly.
I tried calling the .kshrc from with .profile and still nothing.

I did place echos from with the .kshrc file; get the echo's but the
environment is still not being customized.

I know it has to be something real stupid and right in front
of my face.
# 4  
Old 03-05-2007
Which shell is the default shell that u are using?

if it's not ksh, then a lot of the commands in the .kshrc make it invalid, also did you try using the '.' as I mentioned.
I see the first script starts with ':' meaning that it is the regular shell. if the user is supposed to use ksh, set it in the password file and change the : to #!/bin/ksh.
# 5  
Old 03-05-2007
Code:
# cat .profile
.......
........
.......
....
ENV=${HOME}/.kshrc
.........
......

It's that simple
# 6  
Old 03-05-2007
Quote:
Originally Posted by moshe fried
if it's not ksh, then a lot of the commands in the .kshrc make it invalid, also did you try using the '.' as I mentioned.
I see the first script starts with ':' meaning that it is the regular shell. if the user is supposed to use ksh, set it in the password file and change the : to #!/bin/ksh.
geez ... that was it! ... the shell in /etc/passwd was /bin/sh

Thanks Moshe! ... I knew it was something that simple!!
# 7  
Old 03-05-2007
Quote:
Originally Posted by moshe fried
if it's not ksh, then a lot of the commands in the .kshrc make it invalid, also did you try using the '.' as I mentioned.
I see the first script starts with ':' meaning that it is the regular shell. if the user is supposed to use ksh, set it in the password file and change the : to #!/bin/ksh.
geez ... that was it! I knew it was something really simple.

Thanks Moshe!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Kshrc custom prompt will not work

So Yesterday I switched from Solus Linux to Fedora Linux 30, but I forgot to backup some of my dotfiles including kshrc. I am fairly new to Korn shell and do not know it well, but through memory I was able to at least get this. I did use code from several different source to recreate it. The only... (13 Replies)
Discussion started by: zoomer
13 Replies

2. Infrastructure Monitoring

trap in etc/profile and user .profile

Hello I really wonder what's trap in etc/profile and in each user .profile. I try to google for it but I think I have no luck. Mostly hit is SNMP traps which I think it is not the same thing. I want to know ... 1. What's a "trap 2 3" means and are there any other value I can set... (4 Replies)
Discussion started by: Smith
4 Replies

3. Shell Programming and Scripting

.kshrc is not executing

Hi, I am facing two problems in my environment. Anyone can help on this? Thanks in advance. Problem 1 --------- When i login into my new unix system, only the .profile is executing. .kshrc is not executing. But my default shell is .ksh Any setup to be changed ? Problem 2... (7 Replies)
Discussion started by: senthil_is
7 Replies

4. UNIX for Dummies Questions & Answers

difference between /etc/profile and .profile?

What is the difference between /etc/profile and .profile? (5 Replies)
Discussion started by: gehlnar
5 Replies

5. Shell Programming and Scripting

korn shell .kshrc in sunos

Hi, My login shell is c shell I have a line in .cshrc like setenv a 1000 I have a line in .profile like ENV=$HOME/.kshrc export ENV and in my .kshrc a=10 export a I wrote one korn script #!/bin/ksh echo $a (3 Replies)
Discussion started by: shahnazurs
3 Replies

6. Programming

reading reading data from webpage

hi iam reading data from web page using request socket and curl socket. now my problem is some the web page containg data as a image so how can i read the data from a image. thank,inadvance. sree (3 Replies)
Discussion started by: phani_sree
3 Replies

7. Shell Programming and Scripting

kshrc

An odd problem using .kshrc, if I run with this in my home login directory it works fine other than if I use 'man', where each word of the manual entry is on a seperate line ?. I'm using AIX 5.3 (it worked fine on 5.2). Anyone seen this before ? (3 Replies)
Discussion started by: gefa
3 Replies

8. UNIX for Dummies Questions & Answers

not able to execute .profile /.kshrc

Hi, I m new to Solaris CDE...earlier i was using Windows. Here is my problem.. i know that whatever the initial settings we need to execute,we can place them in .profile file. in my home dir (/home/venki),i have following files for that. .profile .profile.user .kshrc .kshrc.user ... (2 Replies)
Discussion started by: Venky
2 Replies

9. SCO

Difference between .profile and .~/.profile

what is the difference between these two lines, if we use it in korn shell script: .profile .~/.profile (3 Replies)
Discussion started by: maneesh mehta
3 Replies

10. UNIX for Dummies Questions & Answers

changed .profile but didnt ./.profile, yet reflected changes

hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix. please explain.. thanks (4 Replies)
Discussion started by: yls177
4 Replies
Login or Register to Ask a Question