Imagine you have a file
sink(\"example.txt\") data.frame(a = runif(10), b = runif(10), c = runif(10)) sink()
and would want to add some hea
Using bash:
$ cat > license << EOF > /* created on 31.3.2011 */ > /* author */ > /* other redundant information */ > EOF $ sed -i '1i \\' example.txt $ sed -i '1 { > r license > d }' example.txt
Don't know how to do it with one sed command (sed -i -e '1i \\' -e '1 { ... inserts after first line).
sed -i -e '1i \\' -e '1 { ...