Just disable printing out with the -n
option and add the p
modifier to the s///
command to print out lines where substitution has occured. sed -n 's/your-regexp/replacement/p'
Just disable printing out with the -n
option and add the p
modifier to the s///
command to print out lines where substitution has occured. sed -n 's/your-regexp/replacement/p'
It’s practically unrealistic. Even for a distro governed by a US-based company there are a lot of download mirrors, so restricting downloads from all of them is extremely difficult (and anyway unrestricted foreign mirrors still could synchronize with official ones via VPN). Forbidding foreign developers would require identification of each developer, but few distros do this (Debian does, but e.g. Fedora does not).
Developers would understand that such restrictions effectively kill a project, so they would shirk them.
It’s a bad practice to log in as root even for administrative tasks. You need to run numerous commands, some of hem can be potentially dangerous while not requiring root privileges. So normally you have an admin
user in the sudo
/wheel
group and need to login to this account. Also, this adds some protection in case your key has leaked.
Your idea is correct, but I don’t know how to do this in Wndows (while this is pretty simple in linux). However I want to warn you that if the partition that you are dumping is used by the OS, the resulting image will most likely be corrupted. Better use a linux live system and ensure that the partition is not mounted.
find / -lname '/path/you/are/looking/for/*'
Note that the -lname
option is a GNU find
extension and may not work with other find
implementations.
Nope. Free beer ≠ free speech.
#!/bin/sh
printf 'ABC %s: ' "$(date --rfc-3339=date)" | xclip
Can you connect with sftp
? sftp myname@192.168.68.137
Paths are constant, only anchors are generated by forgejo.
You won’t get it here. Everybody will recommend his favorite distro.
IMHO the best would be to solve your problems in OpenSUSE. This is definitely possible. You really need to switch to another distro only if you feel youself uncomfortable with the release cycle, package management tools or packages present in the repo of your current distro.
I didn’t test this, but it will change the whole URL while changes are only needed in its fragment component (after the first #
).
skip the following substitute command if the line contains an http link in markdown format
Why you assume there’s only one link in the line?
Also, you perform substitutions in the whole URL instead only the fragment component.
Removed by mod
Bad advise for sed. regex101 doesn’t support POSIX regexes, so you are unable to get the same results as with sed
.
NB: global substitution s///g
is not applicable here because you need to perform new substitutions in a substituted text. Both sed
regexp syntaxes (basic and extended) don’t support lookarounds that could solve this issue.
As I see, you’ve already got an answer how to convert text to lower case. So I just tell you how to replace all occurrences of %20
with -
. You need to repeat substitution until no matches found. For such iteration you need to use branching to label. Below is sed script with comments.
:subst # label
s/(\[[^]]+\]\([^)#]*#[^)]*)%20([^)]*\))/\1-\2/ # replace the first occurrence of `%20` in the URL fragment
t subst # go to the `subst` label if the substitution took place
However there are some cases when this script will fail, e. g. if there is an escaped ]
character in the link text. You cannot avoid such mistakes using only simple regexps, you need a full featured markdown parser for this.
No way. You completely trust them or you do not trust them at all. In any OS. That’s how security works.
If you want to control users, don’t give them admin privileges.
Most of things you enumerated solve windows specific problems and therefore have no analogs in other OSes.
What is wrong with gitea? Is not forgejo just a slightly modified fork that is regularly synchronized with gitea codebase? I know nothing about motivation of forgejo authors, where can I read about it?
This is not combining commands. In your example
p
is a modifier to thes///
command.