Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 755985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:11:36+00:00 2026-05-14T15:11:36+00:00

We have Oracle running on Solaris, and the shell is by default csh. So

  • 0

We have Oracle running on Solaris, and the shell is by default csh. So the login script sets the oracle_home, oracle_sid in csh also. But I don’t like csh and want to use bash to do my work. So how to source the csh login script in bash?

e.g, the following is what in the .cshrc file. And when use bash, I’d like use these variables. One way is to copy the variables again and use bash command, such as export ORACLE_SID=TEST. But doing so will require us to maintain two copies of the files. And when we change the database name, or upgrade the database, I need to maintain the bash login file separately. It’s nice to just use something like

source .cshr in bash, but it doesn’t work.

setenv ORACLE_SID TEST
setenv ORACLE_HOME /oracle/TEST/home/products/10204
setenv EPC_DISABLED TRUE
setenv MANPATH /usr/local/man:/usr/share/man
setenv EDITOR vi
setenv LD_LIBRARY_PATH $ORACLE_HOME/lib:/usr/sfw/lib/64
setenv NLS_LANG AMERICAN_AMERICA.UTF8
setenv NLS_DATE_FORMAT "DD-MON-RR"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:11:37+00:00Added an answer on May 14, 2026 at 3:11 pm

    In your ~/.bashrc (or the first of ~/.bash_profile, ~/.bash_login, and ~/.profile that exists) source this script using something like . ~/bin/sourcecsh:

    #!/bin/bash
    # This should be sourced rather than executed
    while read cmd var val
    do
        if [[ $cmd == "setenv" ]]
        then
            eval "export $var=$val"
        fi
    done < ~/.cshrc
    

    This version eliminates the evil eval:

    #!/bin/bash
    # This should be sourced rather than executed
    # yes, it will be sourcing within sourcing - what so(u)rcery!
    source /dev/stdin < \
    <(
        while read cmd var val
        do
            if [[ $cmd == "setenv" ]]
            then
                 echo "export $var=$val"
            fi
        done < cshrc
    )
    

    Edit:

    Without sourcing stdin:

    while read cmd var val
    do
        if [[ $cmd == "setenv" ]]
        then
            declare -x "$var=$val"
        fi
    done < cshrc
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an Oracle 10g forms application running on a Solaris OAS server, with
I am running oracle and have a query which pulls some results from the
I'm running Oracle 10g and have columns with Type_Name TIMESTAMP(6) WITH TIME ZONE When
I have a PL/SQL function (running on Oracle 10g) in which I update some
I have a DB running on Oracle. I use Hibernate for data access. I
I have been porting oracle selects, and I have been running across a lot
I have a servlet running in an Oracle OCCAS server. Currently I map some
I have two users Bob and Alice in Oracle, both created by running the
I have a shell script which I'd like to trigger from a J2EE web
Let's say you have an Oracle database running on production-backup. You want to move

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.