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.

Recommended Answers

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

Jump to Post

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 …

Jump to Post

All 5 Replies

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'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?

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.