stanley82 has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: system bash return value
by Laurent_R (Canon) on Dec 20, 2016 at 09:08 UTC | |
by haukex (Archbishop) on Dec 20, 2016 at 12:09 UTC | |
by Laurent_R (Canon) on Dec 20, 2016 at 14:49 UTC | |
by haukex (Archbishop) on Dec 20, 2016 at 15:08 UTC | |
by shawnhcorey (Friar) on Dec 21, 2016 at 13:57 UTC | |
by Laurent_R (Canon) on Dec 21, 2016 at 18:08 UTC | |
|
Re: system bash return value
by LanX (Saint) on Dec 20, 2016 at 02:45 UTC | |
|
Re: system bash return value
by duyet (Friar) on Dec 20, 2016 at 06:46 UTC | |
|
Re: system bash return value
by Anonymous Monk on Dec 20, 2016 at 02:35 UTC |