special-characters

Escape special characters from variables

Escape special characters from variables I have #!/usr/bin/bash search="ldo_vrf18 {" replace="$search"’ compatible = "regulator-fixed"; regulator-name = "vrf18"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; regulator-enable-ramp-delay = <120>;’ sed -i "s/$search/$replace/g" output.file The result is sed: -e expression #1, char 62: unterminated `s’ command I suspect some values arent being escape in replace. Is there a way …

Total answers: 1

Using the SED command with special characters

Using the SED command with special characters Is there a way to use the sed command this to search for a special character at the beginning of line, replace it with another special character, and append a special character to that line only? I did some digging and and have looked thru a few forums, …

Total answers: 1

Entering special characters the same way on Windows and Linux

Entering special characters the same way on Windows and Linux ctrlshiftu followed by the hex value of a Unicode character enters that character. For example, ctrlshiftu41 enters ‘A’, whose value is 0x41 in hex and 65 in decimal. There’s also the compose key, which lets you enter digraphs (e.g. compose keye^ produces ‘ê’). Unfortunately, neither …

Total answers: 2

Encryption Password typing issues

Encryption Password typing issues I just upgraded from Ubuntu 20.04 to Ubuntu 22.04. Upon rebooting, after upgrade finished, I was asked to enter disk encryption password (not loggin password. I have full disk encyption). My defalt keyboard on Ubuntu 20.04 was EN but upon upgrading it was set to SR (Serbian Latinic). The huge issue …

Total answers: 1

Special character password variable from bash to expect block is not working

Special character password variable from bash to expect block is not working I have been struggling with this issue for a few days now. I have scoured the internet for a solution and tried many different methods but none seems to be fruitful so far. I am passing a password variable which contains special characters …

Total answers: 1

Use `find` for filename with []

Use `find` for filename with [] Background: I am trying to find music files that are mentioned in an xml file to organize my music playlists. I’m writing a script to pull out the filenames from the xml tag to automatically find the files. My music lives in $musicroot, so I’m issuing find there. But …

Total answers: 5

Understanding bind mapping to switch between emacs and vi modes

Understanding bind mapping to switch between emacs and vi modes tl;dr If I execute the following in bash, Ctrl+z seems to have no effect bind -m vi-command ‘"C-z": emacs-editing-mode’ bind -m vi-insert ‘"C-z": emacs-editing-mode’ bind -m emacs-standard ‘"C-z": vi-editing-mode’ whereas something dumb like this just works bind -m vi-insert ‘"h": "ciaooooo"’ The origin of this …

Total answers: 1

Bash Parameter Expansion – Get Variables with a Prefix while Escaping Hyphen

Bash Parameter Expansion – Get Variables with a Prefix while Escaping Hyphen EDIT: I realized I was mistaken about a central assumption in this post: The ${!prefix@} syntax isn’t able to get function names, but only variables. Therefore, there is no way to get ${!prefix@} to return function names, even if they used underscores. Thus, …

Total answers: 2

"cat ls" messes up my terminal's characters

"cat ls" messes up my terminal's characters when I go to my /bin directory and do cat ls it messes up my whole terminal’s characters, even my input gets messed up and I have no option but to restart the terminal. I was just watching a toturial and the guy was doing this, his terminal …

Total answers: 1

What are curly quotes and can I use them in my code?

What are curly quotes and can I use them in my code? Somehow curly quotes got into my code and I’m getting unexpected behavior #!/bin/sh if [ foo = ‘foo’ ]; then echo yes else echo no fi I would expect this to echo yes but instead it echoes no. Asked By: jesse_b || Source …

Total answers: 1

"Ctrl + ." displays "e" character and captures the keyboard shortcut

"Ctrl + ." displays "e" character and captures the keyboard shortcut For a few days now I can no longer use Ctrl+. anywhere (which makes working with Vs Code pretty frustrating). Instead of executing the shortcut an e appears. I can then write normally, and when pressing Enter the e disappears. This is similar to …

Total answers: 1

How to copy a file by using its inode number?

How to copy a file by using its inode number? This problem is related to Samba and inodes are not necessary. I have a problem handling a certain file that has some special characters in it. If I search it by its inode it will list the file: $ find . -inum 90505400 -exec ls …

Total answers: 2

Deal with nbsp character in shell

Deal with nbsp character in shell When I use an "alt-gr" character followed by a ‘space’ character often I miss my input in typing in place of it the "non breaking space character" aka nbsp. Example with piped commands : mount |<space>tail vs mount |<nbsp>tail The last command will trigger an error …" tail" command …

Total answers: 1

Are ∈ and ℝ symbols available in eqn/roff?

Are ∈ and ℝ symbols available in eqn/roff? A set of commonly used symbols to represent that a variable belongs to a given real coordinate space are ∈ ("ELEMENT OF", Unicode U+2208) and ℝ ("DOUBLE-STRUCK CAPITAL R", Unicode U+211D). Are those two symbols available in eqn, troff, and/or groff? I can not find them in …

Total answers: 3

What is the difference between a byte and a character (at least *nixwise)?

What is the difference between a byte and a character (at least *nixwise)? I understand that any character is comprised of one or more byte/s. If I am not mistaken, at least in *nix operating systems, a character will generally (or totally?) be comprised of only one byte. What is the difference between a byte …

Total answers: 3