Gents,
Below is the Shell script which I am trying to hold a string of array that is passed from a java file. But it is not working . Can any one please help me to by fixing it.
#!/bin/csh/
set copy = ($argv[*])
echo $copy[1] >> /home/users/bavananr/rrr.log
echo $copy[2] >> /home/users/bavananr/rrr.log
echo $copy[3] >> /home/users/bavananr/rrr.log
echo $copy[4] >> /home/users/bavananr/rrr.log
this should print - Raj Sok Rajesh brajesh
------------------------------------------------------
Below is the java program that i used to call above shell script.
It sucks
public class sample
{
public static void main(String args[]) {
String strCmd = "/home/users/bavananr/Raj.sh";
String str [] = {"Raj","Sok","Rajesh","brajesh"};
Process proc = null;
try{
proc = Runtime.getRuntime().exec(strCmd,str);
}catch (Exception e) {
System.out.println("Exception occurs "+e);
}
}
}