How to get value of shell commands in variableHome › Forums › C Programming › How to get value of shell commands in variableThis topic has 0 replies, 1 voice, and was last updated 12 years, 4 months ago by Anonymous.Viewing 0 reply threadsAuthorPosts September 11, 2008 at 12:33 am #2139 AnonymousInactiveHi all, If We are excuting shell command in c program. then how can we get result of that command in variable?For example: int var; var=system(“uname -r”);This command gives OS version , But in var variable it gives exit status of that command. But I want the OS version in variable.How can we get that?Any idea?Thanks in advance, BKPAuthorPosts Viewing 0 reply threadsYou must be logged in to reply to this topic.Log In Username: Password: Keep me signed inLog In