Operating System - HP-UX
1753937 Members
9590 Online
108811 Solutions
New Discussion юеВ

C Compiler program (memdetail)

 
SOLVED
Go to solution
Vishu
Trusted Contributor

C Compiler program (memdetail)

Hi,

i have read one thread with the following notes :-

---------------------------------
And here's a little program I use called memdetail. It is a c program - compiles with the built in HP-UX compiler.

cc memdetail1.c

mv a.out /usr/local/bin/memdetail

Output like:

# memdetail
Memory Stat total used avail %used
physical 40958.0 28445.2 12512.8 69%
active virtual 30213.0 8304.0 21909.1 27%
active real 19827.2 6694.1 13133.0 34%
memory swap 40958.0 15385.0 25573.0 38%
device swap 83964.0 31218.8 52745.2 37%



Rgds...Geoff

-----------------------------

I downloaded this memdetail program and made a file named memdetail.sh in my server. But when i execute this program with

# sh memdetail.sh

it gives a hell of errors. Please tell me how can i execute this C program in my HP-UX box. I am attaching that program with it for your reference.

Thanks
Ranju
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: C Compiler program (memdetail)

Shalom,

Need to see the errors.

perhaps use tusc and record process detail as well (equivalent of strace in Linux)

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vishu
Trusted Contributor

Re: C Compiler program (memdetail)

Below are the errors :-

$ sh memdetail.sh
memdetail.sh: /1: Execute permission denied.
memdetail.sh[2]: DiSK_OUT: Execute permission denied.
memdetail.sh[3]: DiSK_OUT: Execute permission denied.
memdetail.sh[4]: 11.00: not found.
memdetail.sh[5]: Syntax error at line 6 : `newline or ;' is not expected.
$ memdetail.sh[4]: DiSK_OUT: Execute permission denied.

after this, i interrupted it with ctrl+C. But i think, where in C, we use # to include functions, it may be taken as a comment in shell execution.

James R. Ferguson
Acclaimed Contributor
Solution

Re: C Compiler program (memdetail)

Hi Ranju:

Did you compile like this(?):

# cc ./memdetail.c -o ./memdetail

...where the C program is named 'memdetail.c'

...and then at a shell prompt do:

# ./memdetail

Regards!

...JRF...
Vishu
Trusted Contributor

Re: C Compiler program (memdetail)

Thanks James,

it worked out with cc. Full points to you.

thanks everyone.
Vishu
Trusted Contributor

Re: C Compiler program (memdetail)

closing this thread.