Thank you. This answers my question. I am using Linux, too.
From: arun [smartpink...@yahoo.com]
Sent: Monday, 29 July 2013 11:11 PM
To: Dario Strbenac
Cc: R help
Subject: Re: [R] Declare BASH Array Using R System Function
Hi,
system("names=(X Y);
Hi,
system("names=(X Y); echo ${names[0]}")
#sh: 1: Syntax error: "(" unexpected
#this worked for me:
system("bash -c 'names=(X Y); echo ${names[0]}'")
#X
A.K.
- Original Message -
From: Dario Strbenac
To: "r-help@r-project.org"
Cc:
Sent: Sunday, July 28, 2013 10:00 PM
Subject: [
On 29/07/2013 08:49, peter dalgaard wrote:
On Jul 29, 2013, at 08:27 , Jeff Newmiller wrote:
You seem confused.
Not particularly, but he needs to be aware of _which_ shell R is executing in
system() calls. These things work for me:
system("foo=(bar baz); echo ${foo[1]}")
baz
Dario's iss
On Jul 29, 2013, at 08:27 , Jeff Newmiller wrote:
> You seem confused.
Not particularly, but he needs to be aware of _which_ shell R is executing in
system() calls. These things work for me:
> system("foo=(bar baz); echo ${foo[1]}")
baz
Dario's issue is suggested by his error message
>>> sys
You seem confused. You are programming in R, and asking questions about bash on
an R mailing list. You seem to need to learn the difference between environment
variables and bash variables and how processes acquire and transfer environment
variables, which is really an operating system concept a
5 matches
Mail list logo