Findme Gentoo Script

June 26, 2008 · Posted in Gentoo, Programming · 1 Comment 

I am using Gentoo for 1.5 years. I have a quite big package.keywords and world file. It was very frustrating to locate what files I have on world file ( usually using cat /var/lib/portage/world|grep “package” ) and on package.keywords . I am so bored with this situation so I decided to write a script which will help me locate with ease files on

  • package.keywords
  • package.use
  • package.mask
  • package.unmask
  • world file

    Now I want to share with you this script and I hope it will make your life easier :P

    This is my first “big” bash script. If you find anything wrong in it please let me now :)
    Findme Script

  • Rename files using bash

    May 26, 2008 · Posted in Linux · 7 Comments 

    Lately I had an issue. I wanted to rename all the files in a specific folder. I wanted to change the pattern M.D. to Null. So I wrote a lame bash script to do that

    #!/bin/bash
    for i in *.avi
    do
    filename="${i/.avi}"
    newfile=`echo "$filename"|sed s'/\,\?\ M\.D\.\?//'`
    mv "$i" "$newfile".avi
    done

    However I dont like this way and i m sure that there is a much better way to do that. Do you have any ideas how this operation could be more simple? :)

    Gentoo Users
    GreekBloggers.com
    Patras Wireless Metropolitan Network
    Planet Hellug
    iloog
    forum hellug