The Archives

  • 18.Mar.09
    Play Tetris at the command line fun | rafacas | (0)
    I have been suscribed to sed-users group for quite a while. At sed's home page there is a section named gamez, where one can see some games written in sed such as tic tac toe, pong, sokoban, arkanoid. Some members have contributed more games, like a Julia who wrote tetris, sedtris. Are they not real commandliners? ;-) The following image is a screenshot. Do you feel like gaming?
  • 04.Mar.09
    Removing blank lines from a file shell | rafacas | (0)
    Sometimes I need to remove blank lines from a specific file. I usually do it with the two following commands: $ grep -v "^$" file or $ sed '/^$/d' file Obviously, if you want to save the output you should redirect it to another file, for example: $ sed '/^$/d' file1 > file2
  • 02.Feb.09
    Currency conversion script scripts | rafacas | (1)
    In this time of crisis perhaps we need to pay more attention to financial issues. I am interested in converting some currencies so I have written a script that given two currencies, converts on to the other. The script searches the info on Google Finance's page. An example of its usage is: $ ./ EUR USD 1 EUR = 1.316 USD The available currencies are: EUR - Euros USD - United State Dollar GBP - British Pound JPY - Japanese Yen CHF - Swiss Franc CAD - Canadian Dollar AUD - Australian Dollar INR - Indian ...