With bash, grep keykword file.txt returns 0 to bash on success and 1 or 2 on fail.
In cpp int i = system("grep something file.txt"); //gets the return value in i.
With perl I'm sure @i will capture what normally goes to the terminal stdout. I only need to know if "something" is in "file.txt" or not, any ideas reverend father?
Your son Ian.
In reply to system bash return value by stanley82
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |