For a while I maintained a .html blog using only ed, just for the fun of abstaining from conveniences and learning to use an ancient program. It's somehow nice to know that it's possible.
For a while I maintained a .html blog using only ed, just for the fun of abstaining from conveniences and learning to use an ancient program. It's somehow nice to know that it's possible.
This patch was explicitly rejected in upstream openssh as they said it could lead people to copy and paste it without considering attacks - but ignored the fact that by just telling people what file it was in, many people just deleted the file in response and those who did it right, deleting just the relevant line in cases where a key change was expected like my situation, never discovered the easier ssh-keygen -R method.
Perhaps they shouldn't offer a copy and paste solution, but mentioning that ssh-keygen is capable of it and to see the docs would be nice at least...
This assumes authenticated DNS data, of course. Not at all a given today, sadly.
`sed -i '398d' ~/.ssh/known_hosts`
I do this all the time. In fact I have a function in my .bashrc for this at work since I use it so much:
`function sedkey() { sed -i "${1}d" ~/.ssh/known_hosts }`
so I can run `sedkey 123` etc. Just another way to skin a cat I suppose.
ktm5j@kurma /pool/share/pkgs $ ed ~/.ssh/known_hosts
130923
398d
wq
130755
Sed just quietly does what I want. Like I said, just another way to skin a cat, do whatever works for you.Also, btw, you can absolutely use ed in scripts [0], but this is also something that I would pity the maintainer of.
[0] https://www.ibm.com/developerworks/community/blogs/brian/ent...
For larger things I find vi or something else of that scale more convenient. Ed just seems to fill a space between the two that I never need.
kate filename:line
CTRL+K (or CTRL+D to comment out), CTRL+S, quit (current tab: CTRL+W, Alt+Tab or app: CTRL+Q)
Particularly useful when the output of the previous command (compilation for instance) already contains filename:line. Then double click, middle click paste works well.
or: kate filename
CTRL+G line <Enter>, CTRL+K, CTRL+S, quit.
ed the_file <<< $'398d\nwq'
edit: another one liner but still using ed I guess.