hi all,

i am using a unix script to control various pieces of code,
sometime i call this python script,
HOW can i store the result of the python script
INTO an array defined in my unix script ?

thanx

hi all,

i am using a unix script to control various pieces of code,
sometime i call this python script,
HOW can i store the result of the python script
INTO an array defined in my unix script ?

thanx

What shell are you running?

Here is an example of a bash array. These values are split from a CSV line:

declare -a varray
for aline in `cat $USERFILE`
do
  varray=(`echo $aline | awk '{ split($0, ulist, ","); for(i=1; i<=11; i++) printf ulist[i] " "; }'`)

Note: Doing this in bash is horribly slow & $USERFILE is not /etc/passwd, it is another file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.