.kshrc is not executing

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting .kshrc is not executing
# 1  
Old 08-18-2009
.kshrc is not executing


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

When i view files in vi editor, everytime only 7 lines are displaying in the bottom of the window. Every time i need to scroll down to view 24 lines for a page.

Any vi settings or terminal setup to be changed. ?
# 2  
Old 08-18-2009

.kshrc will run if the value of the ENV environment variable is set (to .kshrc) after login - the value of ENV is checked each time ksh is run. This could be set either globally (in /etc/profile, /etc/environment, etc.) or in your own .profile.

export ENV

Or you could just source it in your .profile:

[ -r ~/.kshrc ] && . ~/.kshrc

(then .kshrc would run only once at login, and not for each new invocation of ksh)

Your second problem may be because of your terminal settings.

What does "stty -a" show?

Try changing the number of rows (i.e. "stty rows 40")

Last edited by Scott; 08-18-2009 at 06:17 AM..
# 3  
Old 08-18-2009
Hi Scottn,

Thanks for your reply. For the 2nd problem, this is the output of the stty -a

/rflxbn1/home>stty -a
speed 300 baud; 44 rows; 125 columns
eucw 1:1:0:0, scrw 1:1:0:0:
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ^@
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; dsusp = ^Z; reprint = ^R
discard = ^O; werase = ^W; lnext = <undef>
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -parext
-ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon ixany ixoff -imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop -echoctl -echoprt -echoke -flusho -pending -iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3

the stty rows are already coming as 44.

I manually set it as "stty rows 40". But still facing the same problem.
I am using putty. But with same putty setup in other servers, i am able to see 44 rows in a page.

Any idea?
# 4  
Old 08-18-2009
Apart from the speed (38400) that looks much like mine.

Is it only VI which shows this behaviour, or other commands too (like more, cat, pg, etc)? Do you have a .exrc file that contains something odd?
# 5  
Old 08-18-2009
Hi Scottn,
I tested with cat and pg. i am getting in full screen i.e. 44 rows are displaying in the entire screen.
I tested with tail -f <pgm name>, last 10 lines are displaying and
i tested with tail -40 <pgm name>, this is also displaying 40 lines in the unix promt

Only vi, its displaying first 7 lines. Everytime i have to scroll down to see 8th line.

I dont find any .exrc file in my home directory.
This is new AIX Unix machine.
# 6  
Old 08-18-2009
What is the value of $TERM?
# 7  
Old 08-18-2009
/home/sources>echo $TERM
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. Shell Programming and Scripting

ROOT is not executing

I have this script #!/bin/ksh #set -x if then while do if then date >> /export/home/Tool/checktmp.log echo "`ls -lrt / | grep tmp`" >> /export/home/Tool/checktmp.log echo "`ls -lrt / | grep tmp`" | mailx -s "/tmp permission has changed" -r a.com b.com c.com d.com ... (2 Replies)
Discussion started by: nikhil jain
2 Replies

3. Shell Programming and Scripting

Script not executing

Hi, am facing some problem while inserting a record into a script Please find script below. `sqlplus -s asdf/asdf123 <<eof! set feedback off; set heading off; set verify off; insert into... (3 Replies)
Discussion started by: senkerth
3 Replies

4. Programming

No error but not executing

Hi friends When I compile thic program by gcc filename, it shows no error. But after that if I execute the program gets stuck. Can any one find out. #include<stdio.h> #include<sys/types.h> #include<sys/mman.h> #include<stdlib.h> #include<fcntl.h> #include<sys/stat.h>... (6 Replies)
Discussion started by: gokult
6 Replies

5. Programming

No error but not executing

Hi friends NO errors, but when I try to execute the program it gets struck. Can any one find it out. #include<stdio.h> #include<sys/types.h> #include<sys/mman.h> #include<stdlib.h> #include<fcntl.h> #include<sys/stat.h> #include<unistd.h> #include<signal.h> #include<string.h> ... (0 Replies)
Discussion started by: gokult
0 Replies

6. UNIX for Dummies Questions & Answers

cronjob not executing...

Hi All. I created a cronjob entry and for some reason it is not executing. The script that it is suppose to call sends me an email when it is done. When I run the job manually it executes fine. This how my cron entry looks: 00 14 * * * /home/oracle/scripts/bin/free_space/free_space.sh 2>$1... (5 Replies)
Discussion started by: shaseeb
5 Replies

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

8. Shell Programming and Scripting

.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... (7 Replies)
Discussion started by: gseyforth
7 Replies

9. Shell Programming and Scripting


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

10. 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
Login or Register to Ask a Question