LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-12-2013, 04:29 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
run program


I would like to have a simple script to do the following , would advise how to make it , very thanks
run the script (the script is called test.p) then see the output , if the output contains the string "warning" , then return 1 , if else , then return 0 .
 
Old 09-12-2013, 04:33 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
what have you done so far?
 
Old 09-12-2013, 04:56 AM   #3
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
way too easy

the 'answer' can be found here
https://www.linuxquestions.org/questions/showthread.php?p=4834097
 
1 members found this post helpful.
Old 09-12-2013, 09:43 AM   #4
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
sorry all ,

may be I adjust the requirement , what I really would like to do should be as follow , very thanks if you can help

I would like to have a simple PERL script , this perl script should do the following
first run the bash shell command then see the output , if the output contains the string "warning" , then return 1 , if else , then return 0
 
Old 09-12-2013, 09:44 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
what have you done so far?
 
1 members found this post helpful.
Old 09-12-2013, 09:52 AM   #6
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
Is this that bash script which you want to run in the perl program here?
http://www.linuxquestions.org/questi...pt-4175476858/
 
1 members found this post helpful.
Old 09-12-2013, 10:04 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ust View Post
sorry all ,

may be I adjust the requirement , what I really would like to do should be as follow , very thanks if you can help

I would like to have a simple PERL script , this perl script should do the following
first run the bash shell command then see the output , if the output contains the string "warning" , then return 1 , if else , then return 0
Then see your other thread where you asked the same question.

Again, you've been here TEN YEARS...after an entire decade, can you not write a shell script or do a small bit of research on your own?
 
1 members found this post helpful.
Old 09-12-2013, 11:30 AM   #8
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by eklavya View Post
Is this that bash script which you want to run in the perl program here?
http://www.linuxquestions.org/questi...pt-4175476858/
yes , I will close another thread

As I think the thread in this forum is more related to my problem

Last edited by ust; 09-12-2013 at 11:31 AM.
 
Old 09-12-2013, 02:55 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ust View Post
yes , I will close another thread
As I think the thread in this forum is more related to my problem
They are BOTH THE SAME; and again, after TEN YEARS, writing a bash script or using Google should be something you can handle.
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help Trying to open or run a file/program through a c++ program xskycamefalling Programming 4 01-19-2010 02:26 PM
Need help Trying to open or run a file/program through a c++ program xskycamefalling Programming 2 01-18-2010 02:51 PM
Simple C++ Program: Program Compiles But Won't Run (Segmentation Fault) violagirl23 Programming 3 01-09-2008 12:09 AM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 08:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration