Re: [R] Declare BASH Array Using R System Function

2013-07-29 Thread Dario Strbenac
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);

Re: [R] Declare BASH Array Using R System Function

2013-07-29 Thread arun
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: [

Re: [R] Declare BASH Array Using R System Function

2013-07-29 Thread Prof Brian Ripley
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

Re: [R] Declare BASH Array Using R System Function

2013-07-29 Thread peter dalgaard
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

Re: [R] Declare BASH Array Using R System Function

2013-07-28 Thread Jeff Newmiller
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