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

  • SEARCH
  • Home
  • 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 194853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:37:51+00:00 2026-05-11T16:37:51+00:00

I know this is lame way to do it. We need to capture a

  • 0

I know this is lame way to do it. We need to capture a string that is dynamically generated in a Java program in the calling shell script and then use it later.

Also this is to be done in an existing csh file.

We considered the option of exporting it to an environment variable using putenv/setenv … is that a better option? If so how to use it?

There seems to be lack of example code on net on how to effectively use sentenv() or putenv() and what libraries to import for the same.

System class that has the getenv() method does not show my putenv() or setenv(). Any help is highly appreciated.

Thanks.

  • 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-11T16:37:51+00:00Added an answer on May 11, 2026 at 4:37 pm

    You should be able to just use command substitution, using backtick syntax just as in bash (in bash nowadays, the more usable $-syntax is recommended). Like so:

    $ set A=`java MyProgram`
    $ echo $A
    

    or something very similar

    You cannot use the environment; it’s not possible to communicate “backwards” using it; a child process cannot change the parent’s environment.

    UPDATED: Added the ‘set’ keyword in the example, d’oh.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay I know this is a really lame question because Starbasic is a really
Sorry, I know this is a very lame question to ask and not of
Anyone know this compiler feature? It seems GCC support that. How does it work?
I know this question may be lame, but I'm trying to find a list
In Java I have a string like this 0564\n5523\n5445\n8596 and I'd like more or
Well this is going to sound like a lame question, I know. This is
The reason why I ask this is because I need to know whether not
I know this is such a lame question to ask, but it seems like
Know this might be rather basic, but I been trying to figure out how
I know this might be a no-brainer, but please read on. I also know

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.