Skip to main content

Questions tagged [escape-characters]

Escape sequences such as encodings of terminal commands and function keys

0 votes
2 answers
80 views

I'm writing a shell script that's aimed to be as portable and POSIX-compatible as possible, so usage of bash-only commands or high-level input libraries is undesirable. I'm looking for a way to read a ...
carbon-starlight's user avatar
1 vote
1 answer
102 views

For Linux terminals in general - whether it's the virtual console (tty), GNU Screen, xterm, SSH, etc., is there any situation where the console code DECCRM from man 4 console_codes does something? ...
jordanbell2357's user avatar
1 vote
1 answer
167 views

OSC (“Operating System Commands”) 9;4;x;y sequences are codes that inform the terminal of the progress of any task. Each software has to implement this support to report the progress, and the terminal ...
A.L's user avatar
  • 2,132
3 votes
6 answers
461 views

I've tried using sed for this. I've tried putting the lines of interest in variables as well. I have two examples I want to achieve for now. Lets say I have thousands of urls in a file called links....
shrykullgod's user avatar
0 votes
1 answer
212 views

I have this code, which does what I want, but I don't entirely understand it: #!/usr/bin/env bash echo -ne "\033[6n" # Ask the terminal to print out the cursor's position ...
user153064's user avatar
1 vote
1 answer
209 views

I'm trying to break a long command substitution on to multiple lines, as discussed in this answer. In a plain command pipeline, both explicit (\) and implicit line continuation work fine: $ echo 'blah ...
Jacktose's user avatar
  • 532
9 votes
3 answers
943 views

Let's say hypothetically I'm executing a long-running bash script, and while it's running, I accidentally right click on the terminal and paste a sensitive password (freshly copied out of a password ...
Ivoirians's user avatar
  • 193
1 vote
1 answer
118 views

General overview I have to set a values auto-completion in zsh for a command (in the following minimal example, I will show it with testcmd). So my current code work quiet well with hardcoded values: ...
fauve's user avatar
  • 1,529
8 votes
2 answers
1k views

The only file in my current working directory is called test.txt and its content is simply: This is a little test file. Executing grep -in * -e 'te.?t file' gives no match. But escaping ? works: grep ...
Dominic van der Zypen's user avatar
3 votes
2 answers
2k views

I sometimes need to write JSON strings containing a string value that is itself a JSON string. e.g. In the following JSON object: echo '{"rec" : " {\"id\": 1, \"name\&...
tinlyx's user avatar
  • 1,118
0 votes
1 answer
150 views

When using the save/restore cursor escape sequences \e7 & \e8, I find that it not only restores the cursor position, but it also restores the text formatting (colors). I've tried under WSL, vscode ...
Reinstate Monica's user avatar
0 votes
0 answers
45 views

I'm not sure if this is the right place to ask this. Or should I ask on StackOverflow and show my code. But maybe someone will be able to tell my by just looking at the symptoms. I have a custom REPL ...
jcubic's user avatar
  • 10.5k
-1 votes
2 answers
280 views

i grep something like: str='"a\nb"' echo ${str} | grep -E -o '".*"' and got: "a\nb" i wish the result displays like: a b how could this be done? thanks p.s. actually, ...
furynerd's user avatar
0 votes
0 answers
43 views

if i use the following export PS1='\033[36m$ \033[0m' Bash misunderstands the length of the prompt and starts line-wrapping too early. My assumption was that it is counting every character, but ...
user21749640's user avatar
0 votes
0 answers
167 views

I use ANSI colorized text output in logs and other output that I emit on stderr in some of my programs. Since I've been doing this kind of thing for years, I am pretty familiar with the capabilities. ...
Steven Lu's user avatar
  • 2,442

15 30 50 per page
1
2 3 4 5
32