{"id":54,"date":"2003-10-27T17:03:47","date_gmt":"2003-10-28T00:03:47","guid":{"rendered":"http:\/\/boulter.com\/blog\/2003\/10\/27\/stupid-unix-tricks-i-learned-today\/"},"modified":"2003-10-27T17:03:47","modified_gmt":"2003-10-28T00:03:47","slug":"stupid-unix-tricks-i-learned-today","status":"publish","type":"post","link":"http:\/\/boulter.com\/blog\/2003\/10\/27\/stupid-unix-tricks-i-learned-today\/","title":{"rendered":"Stupid Unix tricks I learned today"},"content":{"rendered":"<p>If I don&#8217;t write this down in the next 5 minutes, I&#8217;ll surely forget it forever.<\/p>\n<p>emacs had some problems opening a file when when it was checked into cvs. Then it had permissions problems when I moved the ,v file out of the way. The problem was that the disk was mounted on NFS and sudo doesn&#8217;t quite work over NFS. <\/p>\n<p>Instead I decided to be a real man and use vi. First thing I had to do was insert the contents of a another file into the current one. No problem: :r (filename)<\/p>\n<p>Then I had to substitute all $&#8217;s with \\$&#8217;s. Hmm, that was a little tougher. :s subsitiutes only the first instance on one line. Adding \/g does all on the line. To do them all, I had to use this magic incantation:<\/p>\n<p>:1,$s\/\\\/\\$\/g<\/p>\n<p>The first part specifies the range to use.<\/p>\n<p>Who said vi isn&#8217;t intuitive?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If I don&#8217;t write this down in the next 5 minutes, I&#8217;ll surely forget it forever. emacs had some problems opening a file when when it was checked into cvs. Then it had permissions problems when I moved the ,v file out of the way. The problem was that the disk was mounted on NFS &#8230;<\/p>\n<p><a href=\"http:\/\/boulter.com\/blog\/2003\/10\/27\/stupid-unix-tricks-i-learned-today\/\" class=\"more-link\">Continue reading &lsquo;Stupid Unix tricks I learned today&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"http:\/\/boulter.com\/blog\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/boulter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/boulter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/boulter.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/boulter.com\/blog\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":0,"href":"http:\/\/boulter.com\/blog\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"wp:attachment":[{"href":"http:\/\/boulter.com\/blog\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/boulter.com\/blog\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/boulter.com\/blog\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}