rblog

Lovely winter’s day in Oslo yesterday

While my skis where miles away from me I needed some other excuse to get out and enjoy the nice weather yesterday. Decided to take the bus out to Fornebu to pick up my bike there. This picture is taken close to Lysaker

Took a stop on the bridge crossing the road in Bjørvika, using the panorama function of my cell phone.

Took a stop and noticed that my rear tyre is pretty much covered with salt. Need some warm weather pretty soon so I can clean my bike.

I’m a nerd and I’m proud!!

Had a folder with about 350 property files, but with only 150 of them having a valid file name. No problem finding the files with a valid file name using find in combination with regex

find . -regex '.*__.*properties'

Problem is that I do not want to find the files with valid file names, I needed the ones with invalid names, but all the time regex is powerfull doing almost anything except excluding phrases and such (as I have read in various sources found by Google) I had to find a workaround.

So here goes, all from the directory where the files are located

  1. ls > allfiles.txt create a file with all filenames
  2. perl -pi -e ‘s#.*__.*properties##g’ allfiles.txt Remove all valid filenames
  3. perl -pi -e ‘s#^\n##g’ allfiles.txt Turned out that I did not remove the newlines, so to get rid of all the blank lines I needed to issue this command as well.
  4. for i in `cat allfiles.txt`; do svn delete $i; done This oneliner loops through the file, for each line delete the file from subversion (which deletes the file for me)

Voila! Pleased with myself 🙂