How to run .kshrc

Posted on 2004-11-12
Last Modified: 2011-05-05

I want to run a .kshrc file everytime i login.
I have copied the .kshrc file from my colleague's account.
But the scripts she has written are not executing in my account.
like at the prompt is still remaining
instead of
myid@hostname in pwd%

I just thought copying the .kshrc file will do it as on login, it is executed.

Do i need to do something else too?

This is Solaris OS. i am connecting remotely from Windows NT using Exceed.

Question by:dkamdar
    LVL 1

    Expert Comment

    What is your default shell?  It would have to be ksh in order for the .kshrc to process.  You can find out what shell you are running once you are logged in by executing the command, whodo.  You should see output like the following.
    [root@server1 /]# whodo
    Fri Nov 12 10:17:05 CST 2004
    pts/1        user     10:16
        pts/1          934    0:00 sh


    Author Comment


    it is korn shell thats why i was modifying .kshrc
    I found out what the problem was ... i had to export PS1 variable instead of prompt ...

    Thanks Anyways
    LVL 2

    Accepted Solution

    You need to add the environment setting ENV to your .profile. This setting needs to point to your .kshrc (or whatever you name it). I.E:

      export ENV

    After adding these line to your .profile logout and back in again. It should pick up the .kshrc now.

    If you change something in the .kshrc and want to source the new file then from your command prompt in your home directory enter ". .kshrc". This will read in and execute the new settings.
    LVL 2

    Expert Comment

    I appreciate the points. But, why only a grade of C? Was there something I didn't explain well enough? If so let me know what and I will further explain.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
    Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now