Skip to main content

Questions tagged [control-characters]

Use this tag for questions about control characters – non-printing characters used to send signals to the output terminal.

Filter by
Sorted by
Tagged with
0 votes
2 answers
64 views

Difference between non-graphic characters and non-printable characters

My system: Ubuntu 22.04.3 LTS GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu) man ls describes -b as follows: -b, --escape print C-style escapes for nongraphic characters The ...
yossi-matkal's user avatar
0 votes
0 answers
49 views

Binary file with field seperator ^A is not loading using SQLLDR

I'm trying to upload .dat file to Oracle DB using SQLLDR.  File data columns are separated by "^A".  File charset is of binary. bash-4.4$ file -i /tmp/t_details_all_data_20240209.dat /tmp/...
Pat's user avatar
  • 239
0 votes
0 answers
15 views

Simulating control characters such as "H key" , "UP arrow key" , etc

I have a Device 1 which has debian OS installed on it. I access the serial console of it through other device i.e. Device 2 . I have scripts on the device 2 which will uninstall and install different ...
Anubhav Rai's user avatar
2 votes
0 answers
30 views

Apply control charactes to file reddirect

Tried various existing answers, but didn't find any which entirely works. This is one line example, and show how it fails, maybe some extra switch or step can solve this? This is the content of file I ...
watbywbarif's user avatar
1 vote
3 answers
370 views

Where are the characters going?

In a shell where \u is valid (bash +4.3, ksh93 or zsh) we can print Unicode characters: $ printf 'a b c \ua0 \ua1 \ua2 \ua3 \n' a b c ¡ ¢ £ Which are some characters from the Latin-1_Supplement ...
QuartzCristal's user avatar
1 vote
2 answers
334 views

color codes messing up table formatting of printf to xterm

My script-in-progress displays a multi-column colorized table, but the color-codes are interfering with the formatting. The color codes cannot be moved to the format string because the coloring of ...
Mic's user avatar
  • 11
13 votes
1 answer
2k views

Why do ^M and \r behave inconsistently?

Perhaps there are already answers out there that indirectly answer my question, but I've read many of them and haven't yet found a satisfactory answer to this discrepancy. The original meaning of ...
mgarort's user avatar
  • 465
2 votes
1 answer
387 views

What can the C1 control codes be used for?

Today I discovered that there is a significantly large group of additional control codes, called C1 control codes, spanning from U+0080—U+009F (32 characters). I think that it's an interesting fact ...
psprint's user avatar
  • 241
0 votes
0 answers
258 views

Control characters in bash history scramble subsequent lines

Sometimes, when I invoke history in bash, it starts printing normally, and at some point switches to garbled characters: Oddly, when I copy that from my terminal and paste it here, the characters are ...
Jacktose's user avatar
  • 441
7 votes
1 answer
875 views

gnome-terminal: strange control characters on Alt key

I probably misconfigured something, but I don't know what. (see UPDATE 1 and 2 below) In gnome-terminal, when I hit Alt (without any other key), it immediately sends ^[< to the terminal (I tested ...
Stuck's user avatar
  • 161
2 votes
2 answers
1k views

How can I change CMD to CTRL in Linux Mint only in Terminal?

I installed Linux Mint on my MacBook Air, and I prefer to use Cmd for copying/pasting, opening and closing windows, and general things like that. However, I would like to use Ctrl to input to the ...
LostXOR's user avatar
  • 225
0 votes
0 answers
456 views

Why are rapid Ctrl-Space sequences sometimes handled differently by GNU screen than slow Ctrl-Space?

I have GNU screen configured to use Ctrl+Space as the escape character. This means that Ctrl+SpaceSpace will send a literal Ctrl+Space to the process in the window. Also, Ctrl+Space Ctrl+Space is the ...
Wildcard's user avatar
  • 36.8k
0 votes
2 answers
157 views

How to dynamically look up shell variable name [duplicate]

I have this situation: zmx_stderr='\033[1;35m' zmx_stdout='\033[1;36m' tag='foobar' tailing(){ echo "tailing logs for ${tag} ..."; while read line; do echo -e "$zmx_${1} $tag $1${...
user avatar
5 votes
1 answer
5k views

`cat -v` for non-printing non-ascii UTF characters

cat has a -v option which converts non-printing characters to their caret notation (which is useful if we don't want the terminal to interpret the control characters literally in cat output). But ...
flow2k's user avatar
  • 621
2 votes
1 answer
692 views

screen logging - How to ommit interactive shell control characters and prompt?

One of my first questions. Please comment if further explanation or information is required or if the question is not like it's supposed to be here I'm using screen to automatically start servers (...
Niklas Gschaider's user avatar
5 votes
2 answers
820 views

When will an interactively typed backspace be passed as input?

I just noticed that I've seen different behavior across different systems when creating a quick test file (e.g. with sample input) via cat and redirection. Here are the steps to see what I'm talking ...
Wildcard's user avatar
  • 36.8k
5 votes
3 answers
21k views

How to find control characters in a file?

I want to find what control characters are in my file. I do not search for specific character, but it is possible \t or \n. I have a program that is telling me: Invalid control character. But when I ...
user9371654's user avatar
1 vote
2 answers
37 views

Multi-file multi-directory removal of ^@

I have multiple files in multiple subdirectories where I need to remove all instances of the control character "^@". Just a basic grep doesn't seems to be working. This what I've tried most ...
Bryan's user avatar
  • 13
0 votes
0 answers
51 views

when can I view \t as a character which spans a fixed width, instead of a control character which jumps to the next tab stop?

I always thought \t as a character, and never realize they are used by terminals for column/field alignment, until Stephane said What does `pr -e` mean? printf '%b' '\t' or printf '\t' writes a ...
Tim's user avatar
  • 103k
2 votes
1 answer
3k views

tmux: backspace and ctrl-backspace send both ^?

With FreeBSD 11.1 and tmux 2.7, pressing ← (backspace) sends ^? and ctrl+← does also send ^?. The default behavior (no tmux) is: ^H for ← ^? for ctrl+← How can I get this default behavior with ...
viuser's user avatar
  • 2,624
0 votes
1 answer
4k views

What is this sequence of control characters (M-bM-^TM-^@) (dashes)? How can I transform these? [closed]

I have a 'typescript' file that if i cat -v I get the following within the output: M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-...
Chris Stryczynski's user avatar
-1 votes
1 answer
8k views

How to find invalid characters? [closed]

I am trying to filter out record which is having "invalid character"(like control-m ^M characters or simply not valid characters). Example: 12345 vimal 1235566 ^zfood nation Here, the ^z, which in ...
Vimal Kumar's user avatar
1 vote
0 answers
215 views

How to stop python-based borg backup from logging with ^M

I'm trying to make a log file for monitoring backup progress using borg deduplicating archiver. While I am logging, the file contains ^M control characters for each line despite running the script on ...
wdkrnls's user avatar
  • 467
2 votes
0 answers
475 views

Show colors from child shell in parent shell

I solved this once, but I cannot remember how I did! In my child process, I have this: echo -e "some control chars" In my parent process, it will show the plain string, without any terminal styling....
Alexander Mills's user avatar
-1 votes
3 answers
1k views

Get colors in bash shell [duplicate]

I have this: ql_gray='\033[1;30m' ql_magenta='\033[1;35m' ql_cyan='\033[1;36m' ql_orange='\033[1;33m' ql_green='\033[1;32m' ql_no_color='\033[0m' I use them like so: echo "${ql_magenta}quicklock: ...
Alexander Mills's user avatar
1 vote
1 answer
859 views

What does an application read when the user press a backspace in the terminal in raw mode?

In raw mode, if you type a character in the terminal, the application on the other side will read the ASCII code for the typed character. But what about when you press the backspace key in the ...
user259116's user avatar
0 votes
2 answers
860 views

Prevent the line discipline from handling control characters

When you send a control character from the terminal, for example if you pressed Ctrl+C, the line discipline will receive the byte representing this control character (which is 0x03 in the case of Ctrl+...
Joseph's user avatar
  • 385
0 votes
1 answer
193 views

Why do colors not show up (control characters) when piping stdout/stderr on *nix systems?

Why do colors not show up (control characters) when piping stdout/stderr on *nix systems? When I do: foo | bar if foo writes color encoded strings (with control chars) to stdout, they won't show up ...
Alexander Mills's user avatar
13 votes
4 answers
7k views

Determine how long tabs '\t' are on a line

In a text processing field is there a way to know if a tab is 8 characters in length (the default length) or less? For example, if I have a sample file with tab delimiter and the content of a field ...
αғsнιη's user avatar
  • 41.5k