Share your knowledge at the LQ Wiki.
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 02-21-2004, 02:09 PM   #1
Registered: Oct 2003
Location: Ireland
Distribution: Slackware 9.1, Ubuntu
Posts: 192

Rep: Reputation: 30
Red face redirecting stderr

I need a quick way of redirecting stderr. im writing a cgi script so I have no terminal, and Im stuck on one seemingly simple line of code:

for (i=(23-hourstoshift); i>=0; i--) inhits[i+hourstoshift]=inhits[i];

its for a hit counter btw
Old 02-21-2004, 02:22 PM   #2
Registered: Oct 2003
Location: Ireland
Distribution: Slackware 9.1, Ubuntu
Posts: 192

Original Poster
Rep: Reputation: 30
its OK, as usual , i figured it out just after I posted it to a forum!

I had declared i as an unsigned int, so when i decreased to -1 the program treated it as 2^32 and kept decreasing

Old 03-11-2004, 10:58 AM   #3
Senior Member
Registered: Mar 2004
Location: england
Distribution: NetBSD, Void, Debian, Mint, Ubuntu, Puppy, Raspbian
Posts: 3,487

Rep: Reputation: 233Reputation: 233Reputation: 233

bad_command 2> errfile


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
stderr is not a tty - where are you? lazyboy0001 Slackware 12 12-02-2005 09:44 AM
stderr messages bokini Linux - General 1 11-29-2005 07:30 AM
Redirecting error messages to stderr and file in Bash lowpro2k3 Programming 1 04-14-2005 06:47 PM
redirecting stdout and stderr to a file Avatar33 Programming 4 03-12-2005 07:55 AM
stderr is not a tty where are you? davidschob Slackware 6 10-31-2003 10:38 AM > Forums > Non-*NIX Forums > Programming

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

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
Open Source Consulting | Domain Registration