LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-24-2011, 07:42 AM   #1
HymaNagendra
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Rep: Reputation: Disabled
syslog() is printing ^I for tab


syslog(priority, "%s", string);
syslog() is printing ^I when string contains \t (tab) and printing ^M when string contains \r (carriage return).
 
Old 10-24-2011, 02:52 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,138

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
On some systems it will convert them to "#011" and "#015".
 
Old 10-25-2011, 01:04 AM   #3
HymaNagendra
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
How to print tab properly using syslog()
 
Old 10-25-2011, 06:13 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Do you mean printing on paper or do you mean that's what the terminal or an editor is showing?
 
Old 10-25-2011, 06:57 PM   #5
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,138

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Quote:
Originally Posted by HymaNagendra View Post
How to print tab properly using syslog()
What do you mean? Tab is an ASCII control character that means move the print head to the next tab stop. Its supported on terminals using termcap. The log device doesn't support it, so it converts it to printable characters when it is logged.
 
Old 10-26-2011, 01:27 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Incidentally
Code:
Unix line end = \n
MACOS = \r
MSDOS (& MSWIN) = \r\n
You don't want \r in syslog ...
 
Old 12-14-2011, 11:40 PM   #7
HymaNagendra
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
The syslog messages are routed to SCSterm through serial port. On SCSterm I'm seeing ^I where ever \t is there in the log message. Do I need to change SCSterm capabilities to print the tab properly or do I need to change any setting of syslog.
 
Old 12-15-2011, 04:31 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by HymaNagendra View Post
The syslog messages are routed to SCSterm through serial port. On SCSterm I'm seeing ^I where ever \t is there in the log message. Do I need to change SCSterm capabilities to print the tab properly or do I need to change any setting of syslog.
That depends on whether SCSterm is receiving a tab and displaying it as ^I or receiving a ^ followed by an I. If the first, changing the SCSterm configuration would be sane ... ?
 
  


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
[syslog] log printing kkokdae Linux - Software 1 07-19-2009 07:21 PM
I need help getting syslog to log remotely, this is just the regular syslog. abefroman Linux - Software 2 06-05-2008 11:36 AM
printing from syslog-ng nathan2225 Programming 1 05-23-2007 03:47 AM
FC 4. Modify ALT+TAB behaviour to CTRL+TAB xtracto Linux - Software 1 09-22-2005 02:06 PM
Redirecting output of tab tab benjaminrtz Linux - General 1 04-28-2003 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:05 PM.

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