Solved

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

Posted on 2006-07-09
9
341 Views
Last Modified: 2010-04-15
Hi,

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

thanks,
0
Comment
Question by:arijit_rebaca
9 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17070847
Hi arijit_rebaca,

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

Cheers!
sunnycoder
0
 

Author Comment

by:arijit_rebaca
ID: 17070932
no..

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

0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 50 total points
ID: 17071048
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:arijit_rebaca
ID: 17071216
Can u write whole code block? it will be helpful for me...

thanks,


0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17071228
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
 
LVL 8

Expert Comment

by:manish_regmi
ID: 17072024
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
 
LVL 86

Expert Comment

by:jkr
ID: 17085591
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
 

Author Comment

by:arijit_rebaca
ID: 17089049
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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question