answersLogoWhite

0


Best Answer

Save the old value, before you change it!

char *old_path = strdup (getenv ("PATH"));

putenv ("PATH=/new/path");

...

sprintf (tmp, "PATH=%s", old_path);

putenv (tmp);

free (old_path);

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How could he easily return PATH to its original value?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How easily return PATH to its original value?

In C? It's only: putenv ("PATH=<insert old value here>");


How could you easily return PATH to its original value after deleting it accidentally?

Assuming you know what the original path was, just retype at the command prompt: PATH=... whatever you had before ... Or: log out of your session and log back in again.


What is the value of 1858 Remington 36 cal navy in perfect condition?

In ORIGINAL perfect condition the value could easily exceed 15,000 maybe even 20,000 but I'd be hard pressed to believe it's original perfect condition without examining it.


How do you return a value in a PHP function?

Below is a simple example of how you could return a value in a PHP function. <?php function returnme($value) { return $value; } echo returnme('hello'); // outputs: hello ?>


Is fork is an process?

The fork() library function makes a copy of the calling process. The original copy continues with a return value of the process ID of the new process, while the new copy continues with a return value of zero. If there is an error, the original process continues with a return value of -1. So, the answer is that fork is a process creation function.


What is the value of a Colt M1911 serial number 380436 with original World War 1 holster and two magazines?

Depends on originality and condition. Could easily be worth into the thousands of dollars if absolutely original and in collectable condition. If it has been modified or reblued, value drops under $500 fast. sales@countrygunsmith.net


How do you create an algorithm that will read the values of A and B and will determine which has the higher value?

The algorithm can be easily stated as follows: if A is greater than B then return A, otherwise return B.


What is the value of tan 114 degrees?

tan114 = - 2.24604. This could easily be found by inputting the degree value into a calculator!


What is 75.36 rounded to the nearest tenth of a millimeter?

75.36 rounded to the nearest tenth millimetre could be 75360.0 if the original value was 75.36 metres, or the answer could be 0.0 if the original value was 75.36 nanometres. Units DO matter!


What is current yield?

A current yield is a bond's annual return based on its current price. This is different from its original price and face value.


What is a current yield?

A current yield is a bond's annual return based on its current price. This is different from its original price and face value.


How do you determine the percent change?

You have an original value and a new value. Take the new value and subtract the original value. Then divide that number by the original value.