LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-01-2004, 10:43 PM   #1
kamel
LQ Newbie
 
Registered: May 2004
Posts: 13

Rep: Reputation: 0
How to disable console output


I would like to disable console output. For example when I do:

system("ls -d ~/dirname > logfile.log"); to determine is a folder exists, if it doesn't the text "folder does not exist" is outputted into the console which is really annoying when writing curses progarms. How can I get it to stop?
 
Old 06-01-2004, 11:17 PM   #2
rkef
Member
 
Registered: Mar 2004
Location: bursa
Posts: 110

Rep: Reputation: 15
What you're redirecting in your shell command there, is just the stdout (file descriptor 1). You need to either specify &>logfile.log, for example, or 2>/dev/null and > logfile.log to junk the stderr (file descriptor 2).
 
Old 06-02-2004, 01:41 PM   #3
kamel
LQ Newbie
 
Registered: May 2004
Posts: 13

Original Poster
Rep: Reputation: 0
ah! thank you very mich a nice, quick, simple fix.
 
  


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
How do you disable console mode? shuego Debian 8 12-08-2005 06:50 PM
i will disable this x-server for now... back to console? acidjuice Slackware 5 02-17-2005 08:43 PM
Console screensaver won't disable jev-bird Linux - Software 0 10-13-2004 12:51 PM
anyone knows how to disable color for vim in console? linuxzouk Linux - Newbie 2 06-07-2004 10:58 PM
Disable the console beep? csvke Linux - General 6 03-01-2004 04:00 AM

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

All times are GMT -5. The time now is 10:15 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
Open Source Consulting | Domain Registration