Link to home
Start Free TrialLog in
Avatar of vmahendru
vmahendru

asked on

how can i store the o/p of Unix cmd to Shell ver.

i want to store the Output of Cmd like
 " wc -c filename" in a Shell var...
 how can i do it..
thanx
ASKER CERTIFIED SOLUTION
Avatar of ravindra042100
ravindra042100

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vmahendru
vmahendru

ASKER

Adjusted points from 25 to 50
it did not work out... first tell me
 can u please explain the steps .. i am not very good in UNIX...
   
Avatar of ozo
What did not work when you tried it?
In which shell do you want to store a variable?
hi ozo
   i have written a program in c and in this program made one system call for grep... i want to store the output of this grep Cmd in my C program... can u help me how can i do it..
  thanx
From C, you might call grep with popen insteead of system.
thanx ozo,  i got the answer