We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,451 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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

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.

2
Contributors
5
Replies
1 Hour
Discussion Span
2 Years Ago
Last Updated
6
Views
333kyle333
Newbie Poster
7 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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

Stefano Mtangoo
Senior Poster
3,731 posts since Jun 2007
Reputation Points: 462
Solved Threads: 396
Skill Endorsements: 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. :(

333kyle333
Newbie Poster
7 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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?

Stefano Mtangoo
Senior Poster
3,731 posts since Jun 2007
Reputation Points: 462
Solved Threads: 396
Skill Endorsements: 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.

333kyle333
Newbie Poster
7 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

333kyle333
Newbie Poster
7 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0768 seconds using 2.75MB