LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-14-2007, 10:25 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
run program


I have a script that run some commnad for the application , when the script run , it will pop up some message to the screen , if I don't want have any message to the screen , what can i do ? I know something like 2>> /dev/null can output the message to somewhere , if use this kind of method , how can I embed it to script ?

Last edited by ust; 12-14-2007 at 10:37 AM.
 
Old 12-14-2007, 10:50 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Please provide some details. This vague stuff:
Quote:
some program... some script... some message...
...is not helpful at all.
 
Old 12-14-2007, 11:13 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by matthewg42 View Post
Please provide some details. This vague stuff:
...is not helpful at all.
we use the database so called accpac ( this is not popular one ) , we need to purge some unused data in a period of time , every time we run the comnand to purge it , it will pop message to the screen even there is no error .

thx
 
Old 12-14-2007, 06:22 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
How is the message displayed - on a terminal in text mode, in an x-window?
 
Old 12-14-2007, 07:19 PM   #5
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by matthewg42 View Post
How is the message displayed - on a terminal in text mode, in an x-window?
thx ,
terminal in text mode.
 
Old 12-14-2007, 07:38 PM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
If you don't want to see any output from a program, re-direct both stdout and stderr:
Code:
command > /dev/null 2>&1
 
Old 12-14-2007, 09:12 PM   #7
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by matthewg42 View Post
If you don't want to see any output from a program, re-direct both stdout and stderr:
Code:
command > /dev/null 2>&1

thx ,

what is the function of 2>&1 ? is "output error to the standand output" ?


thx
 
Old 12-14-2007, 10:22 PM   #8
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Copy file descriptor 2 to wherever file descriptor 1 is going. 1 is stdout, 2 is stderr (0 is stdin).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to run a program in an ssh session that will run after you close out the session? dr_zayus69 Linux - Networking 5 03-05-2006 08:15 PM
run another program in a program becky_starr Programming 7 02-15-2004 12:46 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 09:19 AM
Want to run a program from a program GoboFraggle Programming 3 04-21-2003 09:30 PM
want to run my C program........ gurpreetpall Programming 4 03-22-2002 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:40 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration