Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I put a copy of script fix, but I still have some questions :</p> <pre><code>#!/usr/bin/env bash # Execute R process # ----------------- ### Mysql Setup ### USER=... PASS=... HOST=... DB=... # Get Job ID process # Use to retrieve args in my DB ID=$1 # Get script name RFILE=$(mysql -u$USER -p$PASS -se "SELECT script_name FROM JobProcess WHERE script_run_id=$ID;" $DB) # Get script_args ARGUMENTS=$(mysql -u$USER -p$PASS -se "SELECT script_args FROM JobProcess WHERE script_run_id=$ID;" $DB) RUN="Rscript $RFILE $ARGUMENTS" eval "$RUN" </code></pre> <p>Actually, I can't use (probably due to bad seperated token) : Rscript $RFILE $ARGUMENTS, or $RUN.</p> <p>The purpose of this script is to run any R script by recovering all the parameters in database. Here a copy of data in my DB :</p> <pre><code>script_run_id : 161 script_name : /Users/GR/web-app/Rproject/Scripts/arg_file_test.R script_args : 'path_in&lt;-"/Users/GR/web-app/Rproject/Inputs/Rscript/Gene.csv"' 'path_in2&lt;-"/Users/GR/web-app/Rproject/Inputs/Rscript/Template_Auto.csv"' l=0 w=0 </code></pre> <p>Part script_name define R script to call, and scripts_args define arguments used with this R script. In this example, my script generate this command line :</p> <pre><code>Rscript /Users/GR/web-app/Rproject/Scripts/arg_file_test.R 'path_in&lt;-"/Users/GR/web-app/Rproject/Inputs/Rscript/Gene.csv"' 'path_in2&lt;-"/Users/GR/web-app/Rproject/Inputs/Rscript/Template_Auto.csv"' l=0 w=0 </code></pre> <p>Is there a better way to proceed ?<br> For example, define a new column for files path (ex:script_Files) ?<br> Separate arguments with comma (ex:l=0, w=3, r=6, etc), and split string into array (an example can help me) ? </p> <p>Thanks<br> ps : A good way, is probably to use directly Rscript.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload