Skip to content

u/pi-star

In this archive from Jan 2021 to Sep 2021

5
posts
7
comments
4
media
3.2k
score

Top posts

Escaping backlash and double qoutes inside a sed expression (surrounded by double qoutes)

> echo 'output: " ' | sed "s/\"/\"/" output: " > echo 'output: " ' | sed "s/\"/\\"/" output: " > echo 'output: " ' | sed "s/\"/\\\"/" output: \" I want to understand what is happening in the first and second example. What I understand is, since I am using double qoutes for the sed expression, \" is...

1 points11 comments
Open on Reddit

Top comments

Getting into a window manager first time? Well I can give some suggestions, but you might have to do some research to tailor it to your liking.

For managing the time for screen to dim. You can use the xset command, xset s 0 0 Will act like caffein

For a shutdown script, do something like action="$( printf "shutdown\nrestart" | dmenu)" if [ "$action" = "shutdown" ] then sudo shutdown -h now fi

Similarly for the rest

For this you might want to add shutdown to sudoers file.

Pacman -Qu will list packages that need ti be updates, parse it through wc -l to get the number.

i3 lock and slock are nice options for a lock screen

1 points

I understood the point you mentioned regarding the shell. But why would sed escape characters again as the shell did. Stack exchange told me that in seds documentation we have

Each embedded newline in the text shall be preceded by a backslash. Other backslash characters in text shall be removed, and the following character shall be treated literally

putting both these arguments togetherexplains the second half of the problem.

Thanks for the reply

1 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.