Execution of R program as a bash script

Here is a simple example of bash script which executes R code within. Create a file called R.sh with the following content:

#!/bin/bash
R –no-save rfunction(2,5)
[1] 7
>

Display date-clock with simple bash command and while loop

Here is a simple example on how to display date/watch with simple bash command:

$ while true; do clear; date; sleep 1; done

Extract STDERR and redirect STDOUT to /dev/null with bash

I always keep forgetting this bash syntax redirection. This is because of my short memory and also because I do not use it often. In many cases we need to remove a STDERR from the command output and keep only STDOUT. On the other hand there are times that we want to see STDERR and [...]