You're viewing a comment by Michiel and its responses.
You're viewing a comment by Michiel and its responses.
I am being sponsored by Syntress since 2007! They bought me an amazing dedicated server to run catonmat on. If you're looking web services in Chicago area, I highly recommend the Syntress guys!
I love to read science books. They make my day and I get ideas for awesome blog posts, such as Busy Beaver, On Functors, Recursive Regular Expressions and many others.
Take a look at my
Amazon wish list, if you're curious about what I have planned reading next, and want to surprise me. :)


Hi Peteris,
great reading as always. I wondered if you had a solution for a different user preference in #10: I personally prefer to have the extension intact when renaming the file to its name.
I.e. cp /path/to/file.ext /path/to/file_bk.ext
Probably not something I want to do by hand every time, but would be great as a small bash script e.g. 'bk' to first create a safe backup of a file I want to mess with and then automatically launch vim to edit the original.
Thanks!
Comment Responses
What do you think about this?:
cp /long/path/to/file{,_bk}.extHere is a function called
bkthat does it. It works with files both of formfile.extand also files of formfile(without ext). It also checks if the destination file doesn't exist. If it does, it adds_bkuntil such file doesn't exist. After it's copied the file it opens the original invim.Helpful script :-)
Awesome. That is a tutorial in and by itself! The infinite loop is a construct I hadn't used before in bash.
Thank you so much.
Reply To This Comment