March 16th, 2009
The bc shell utility that is available on most UNIX/Linux distributions defaults to integer arithmetic (i.e. throws away anything after the comma). To prevent this, you can set the “scale” option in bc. E.g., the following command will return 3.333: echo “scale=3; 10/3″ | bc
Tags: arithmetic, bc, floating point, Linux, shell, UNIX
Posted in Linux | 1 Comment »
February 27th, 2009
To insert the output of a command (e.g. ‘ls’) below the cursor, type: :r !ls or :read !ls
Tags: editor, Linux, vi, vim
Posted in Linux, Software Development | No Comments »
February 27th, 2009
To insert the contents of a file called /tmp/myfile.txt below the cursor, type: :r /tmp/myfile.txt or :read /tmp/myfile.txt
Tags: insert file, Linux, vi, vim
Posted in Linux, Software Development | No Comments »
February 26th, 2009
The sad things is this actually happened… Credits: xkcd
Tags: funny, idiot
Posted in Geek Humour, Humour | No Comments »