LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 08: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, 03:52 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,614

Rep: Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703
On some systems it will convert them to "#011" and "#015".
 
Old 10-25-2011, 02: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, 07:13 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Do you mean printing on paper or do you mean that's what the terminal or an editor is showing?
 
Old 10-25-2011, 07:57 PM   #5
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,614

Rep: Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703
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, 02:27 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Incidentally
Code:
Unix line end = \n
MACOS = \r
MSDOS (& MSWIN) = \r\n
You don't want \r in syslog ...
 
Old 12-15-2011, 12:40 AM   #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, 05:31 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

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


All times are GMT -5. The time now is 09:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration