Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to reproduce the following command from my textbook on my system,

cat("2 3 4 5", "11 13 14 15", file="ex.dat", sep="\n")

but I keep getting this error:

bash: syntax error near unexpected token `"2 3 4 5"'
share|improve this question
Please don't forget to accept the answer – Ulrich Dangel May 16 '12 at 0:56
up vote 5 down vote accepted

This isn't bash syntax, but rather, is the syntax for the cat command in the R language (a programming language used for statistical computing):

Concatenate and Print

Outputs the objects, concatenating the representations. cat performs much less conversion than print. Usage

cat(... , file = "", sep = " ", fill = FALSE, labels = NULL,  append = FALSE)
share|improve this answer
omg, I am actually learning R only; what happened is that when I saw cat I <somef####nhow> thought that perhaps the first line is creating a file using the linux cat command and the second one is showing how to read the input from the file using R's scan command. GOD; this is silly. – Wildling May 15 '12 at 17:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.