1,105,371 Community Members

C++ on Linux, C++ variable to Env var.

Member Avatar
333kyle333
Newbie Poster
7 posts since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Okay, this is probably gonna sound dumb, but I need to know if it's possible to take a variable held using C++ and make it an environment variable in a Linux terminal. If it makes a difference, I'm using Ubuntu Linux with the Gnome shell.

Member Avatar
Stefano Mtangoo
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 441 [?]
Q&As Helped to Solve: 394 [?]
Skill Endorsements: 2 [?]
 
0
 

Sounds like file modification thing. Use stream classes in <iostream>
Just grab right file to edit. Note: Backup file before modifying so that you can prevent a disaster from happening!

See:
https://help.ubuntu.com/community/EnvironmentVariables

Member Avatar
333kyle333
Newbie Poster
7 posts since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I'm trying to create a simple GUI for a program that runs in the terminal and requires a lot of typing. What I do type in (being saved as a variable in C++) I need to enter into the program which, stated above, is running in the terminal. :(

Member Avatar
Stefano Mtangoo
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 441 [?]
Q&As Helped to Solve: 394 [?]
Skill Endorsements: 2 [?]
 
0
 

I'm trying to create a simple GUI for a program that runs in the terminal and requires a lot of typing. What I do type in (being saved as a variable in C++) I need to enter into the program which, stated above, is running in the terminal. :(

I haven't got you. Could you explain what Kind of app are you using and GUI toolkit you use?

Member Avatar
333kyle333
Newbie Poster
7 posts since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Basically, the program requires a lot of typing. I'm just making a simple CUI (Sorry, not a GUI) that will keep me from having to type a whole lot. Problem is, there is still a little I have to enter into the program. But because I'm entering the info into the program I'm making in C++ I can't use it in the program the CUI is actually for. (If that makes any sense). I can set it as a variable in C++, but not as a environment variable in the terminal, which is what I need to do. I just want to know if there's a way to do that. Transfer a variable held by C++ to an environment variable.

Member Avatar
333kyle333
Newbie Poster
7 posts since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Okay, I've figured it out. But thanks for the concern : )

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: