2

I need to look at some logs (FIX protocol messages from QuickFIX), which use the SOH character as a separator between fields.

I'm connecting to a CentOS server using PuTTY over SSH.

While I can log the session and then search-and-replace the SOH character with '||' (or something similar), I was wondering if there was a way to do it "live", via terminal settings.

1
  • I have the same problem with QuickFIX! I'd also like to view the SOH character in the Linux terminal. Please let me know if you can do this. Dec 26, 2020 at 17:00

1 Answer 1

1

I do not know exactly what you mean by

to do it via terminal settings.

For instance, you can easily visualize SOH by substituting it with this sequence of operations,

   cat -v file | sed 's/\^A/\t/g' | less 

From the manual entry for cat:

-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB

Now Start Of Heading (SOH) has been transformed into ^+A, and the Stream Editor sed replaces it with a Tab (change this as you see fit.

Or, when editing the file with vim, you can display non-printable characters by hitting Esc to enter command mode, then hit

 :set list

and then

 :set nolist

to return to the previous situation.

2
  • Hi. Thanks for the answer! I did come across solutions based on cat and sed elsewhere. I wonder if it's possible to make the terminal do the substitutions or just display the control character as ^A. The reason is that I'm viewing these logs online while the process is running. They're not in a file.
    – Plumenator
    Oct 20, 2015 at 15:27
  • @Plumenator No, there is not a console-setting, if this what you mean. There may be an application setting, like I said. Oct 20, 2015 at 15:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .