LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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


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 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


All times are GMT -5. The time now is 08:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration