• C

write a program in C to show current enviornment variable under linux

Hi,

help me to write a program in C to show current enviornment variable under linux..

thanks,
arijit_rebacaAsked:
Who is Participating?
 
sunnycoderCommented:
environ points to char ** which holds your environement variables ... All you need to do is iterate over this array of strings and print the values!!!!
0
 
sunnycoderCommented:
Hi arijit_rebaca,

This is what you are looking for
http://www.die.net/doc/linux/man/man5/environ.5.html

Cheers!
sunnycoder
0
 
arijit_rebacaAuthor Commented:
no..

I want to write a C code that will show this enviornment variables...

0
WEBINAR: 10 Easy Ways to Lose a Password

Join us on June 27th at 8 am PDT to learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees. We'll cover the importance of multi-factor authentication and how these solutions can better protect your business!

 
arijit_rebacaAuthor Commented:
Can u write whole code block? it will be helpful for me...

thanks,


0
 
sunnycoderCommented:
Your question history indicates that you are in the process of learning C.
I would be glad to help you code this piece but I wont code it for you.

Also, you should consider managing your open questions and grading history ... 9 Bs out of 10 certainly dont look very encouraging.
http://www.experts-exchange.com/help.jsp#hi73
0
 
manish_regmiCommented:
another hint,
  That environ pointer which sunny pointer is the third paramenter to the main
also see getenv() if you want to retrieve the value of specfic value.

regards
Manish Regmi
0
 
jkrCommented:
Paul - I ABSOLUTELY DISAGREE ON DELETING COMMENTS WITHOUT MENTIONING THAT to the others.

As I side note: I'll ask the admins about that conduct, since not only it is impolite and rude, but also unfair and IMO not justified. Not to speak of professionality here.
0
 
arijit_rebacaAuthor Commented:
Hi PaulCaswell,

Ya.... you r right Paul.... ok I try to rectify myself when I am going to grade an answer... Thanks for recollecting my school days.... specially the teachers who are very very poor to give marks. hahahahhahahahhaha........

rgds,

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.