special-characters

using tabs within block for ansible blockinfile module

using tabs within block for ansible blockinfile module I want to output some text with tab as separator using ansible here’s task snippet – name: Create output file blockinfile: block: | Some texttmore text path: ‘{{ playbook_dir }}/output.txt’ create: true CURRENT OUTPUT # BEGIN ANSIBLE MANAGED BLOCK Some texttmore text # END ANSIBLE MANAGED BLOCK …

Total answers: 1

How to replace (***) with (***) with sed

How to replace (***) with (***) with sed so I wanted to write a script to replace special characters with their escaped equivalent so I can pass it to mkdir command. As a friend used a similar line I can use this to replace parantheses with underline like below: echo ‘Hello (World)’ | sed ‘s/(|)/_/g’ …

Total answers: 3

Why is a filename surrounded by double quotes with single quotes around a character when displayed in terminal?

Why is a filename surrounded by double quotes with single quotes around a character when displayed in terminal? Why would a file show up surrounded by double quotes with a character surrounded by single quotes within it? "insight_automation.log’.’2024-03-13" I am using Ubuntu Server 22.04.3 LTS. A service desk management program (Atlassian Jira Data Center 9.12.4 …

Total answers: 1

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