Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 06-01-2004, 11:43 PM   #1
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-02-2004, 12:17 AM   #2
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, 02:41 PM   #3
LQ Newbie
Registered: May 2004
Posts: 13

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


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

All times are GMT -5. The time now is 12:50 AM.

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