-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete line based on match #99
Comments
I am trying to do something similar as well. I have a test file with ignores and I would like to strip out this statement void test_longest_known_isogram(void) and I thought I would be able to strip it with this, but I couldn't get it to work so now I'm not sure if its supported by sd |
Try |
@SimplyDanny is right where the line ending has to be explicitly included to match the full line instead of The current equivalent would be $ cat issue.txt
a
myhostname
b
a myhostname b
c
$ sd --preview '^.*myhostname.*\r?\n' '' issue.txt
a
b
c |
With
sed
, it is posible to do this:This will delete any line in
/etc/hosts
which contains "myhostname".Is there a way to achieve this using
sd
?The text was updated successfully, but these errors were encountered: