@casey Another plug for what @StephenKitt was saying about vcsh. That script really addresses this exact scenario well and smooths out quite a number of pitfalls that you will run into sooner or later doing the same thing manually. It takes a little bit to get your head around what it is doing with detached work trees, but the resulting flexibility and ability to fine tune how manage your dotfiles without putting crimps on the way you use your computer is really worth it.
@Gilles I followed your advice today and flagged only (had to look it up as I almost downvoted and wasn't sure I was supposed to). Should I have left a comment for the others (currently the spam is at -5) or is adding comment more harmful to the spam deletion process than the downvotes are?
@Caleb I'm curious what these pitfalls are, because I don't see them from the description, and I do have experience storing my dot files under VC
I see two difficulties: files that need to be different on different machines, and files that need contain both state and configuration
vcsh doesn't seem to provide a nice interface for different files on different machines. Breaking things down by application is irrelevant. what would be relevant is to tag some files as being site-dependent and check out/symlink different content for these files
As for files with mixed content (state/configuration, or global/local for that matter), I don't see how it helps at all
@Braiam The spam was gone relatively quickly, I had no clue about how many flags where on the post. I just wanted to know if pointing out to the downvoters in a comment just to flag (and not downvote) would be helpful.
Given a file L with one non-negative integer per line and text file F, what would be a fast way to keep only those lines in F, whose line number appears in file L?
Example:
$ cat L.txt
1
3
$ cat F.txt
Hello World
Hallo Welt
Hola mundo
$ command-in-question -x L.txt F.txt
Hello World
Hola mund...
@StephenKitt It won't work for files with >10 lines. join complains that the file is unsorted, I couldn't find a way to make it accept numerical sorting. Shame really, that would be the best way to do it. I'm very open to suggestions.
I have Ubuntu 14.04 running on a Dell Latitude 13 laptop.
When I launch Chromium and open several pages from stackexchange in different tabs. Any text I type in will frequently have characters showing up in a different order from how they were typed. For example, this paragraph actually showed up...
It's just that at the moment your answer has 1) a suggestion with no details of how the OP would go about doing it (give them the commands to install the packages) and 2) a link only answer with all the issues associated with that.
@terdon I've expanded it. The commands are on the web page. Do you want me to quote those commands? That page could go away, I suppose, but it's been there for years.
@FaheemMitha Link rot is part of why we don't like link-only answers. The other part is that they don't actually answer. They indicate where an answer could be found.
I think we can all agree, this sucks:
If you've been around a little while, you've probably encountered hundreds of answers like this in various forums, some of them even marked as "The Answer" by well-meaning1 forum admins looking to close a thread. We could try to enumerate the commonly-obse...