The Archives
-
03.18.09Play Tetris at the command lineI 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?
-
03.04.09Removing blank lines from a fileSometimes 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.02.09Currency conversion scriptIn 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: $ ./currencies.sh 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 ...