I have a variable parameter ( retrieved from a getText field in Seleium Automation) that i want to assign the value into a specefic place in a shell script :
In java this is what i do :
String ref = workcreation.getfield_ref().getText();
try { ProcessBuilder pb = new ProcessBuilder("/home/script.sh");
Process p = pb.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = null;
while ((line = reader.readLine()) != null)
{
System.out.println(line);
System.out.println("in " + reader);
}
p.waitFor();
}
catch (IOException e)
{
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
In script script.sh, i want to assign the value of ref into the parameter &ref in that exact place :
##it is the value of &ref that i want to get
if [ -d "/data/techVersion_$ref" ]; then
echo "le dossier existe dans cccc "
else
echo " le dossier n'existe pas dans cccc !"
exit
fi
what can i do?