![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [KSH] Split string into array | piooooter | Shell Programming and Scripting | 3 | 09-01-2007 12:22 PM |
| String Array | ravikirankethe | UNIX for Dummies Questions & Answers | 6 | 11-15-2006 12:09 PM |
| MAX SIZE ARRAY Can Hold it | epall | UNIX for Advanced & Expert Users | 3 | 06-07-2006 05:05 AM |
| string to array | sumitgarg | UNIX for Dummies Questions & Answers | 6 | 03-07-2005 01:56 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to hold string array in shell scripts
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); } } } |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|