![]() |
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 |
| Array inside an array | manas_ranjan | UNIX for Advanced & Expert Users | 5 | 06-10-2008 03:25 PM |
| Problem inside 'if' | ayankm | Shell Programming and Scripting | 1 | 09-12-2007 09:01 AM |
| formatting textfile inside ksh script using awk not working | tekline | UNIX for Advanced & Expert Users | 6 | 07-03-2007 02:40 AM |
| inside the JVM | rein | UNIX for Advanced & Expert Users | 1 | 08-05-2005 02:57 PM |
| pipes inside | pranki | High Level Programming | 13 | 04-10-2005 11:41 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
set -A arr a1 a2 a3 a4
# START ssh -xq $Server1 -l $Username /usr/bin/ksh <<-EOS integer j=0 for loop in ${arr[*]} do printf "array - ${arr[$j]}\n" (( j = j + 1 )) j=`expr j+1` done EOS # END ========= this is not giving me correct output. I just want to print a1 a2 a3 a4 a5 as per my variable j inside ssh pls do let me know any solution using a variable without a variable directly using a loop for array works fine in ssh and using a variable works fine without ssh but giving problem with ssh i guess ineed to escape few chars which i am nt sure. I'll appriciate if you can post any working dummy code i tried all solution but nothng worked for me. reldb |
|
||||
|
echo "above ssh=" ${arr[2]}
ssh -xq $Server1 -l $Username /usr/bin/ksh <<-EOS for loop in ${arr[*]} do echo "1=" \$loop echo "2=" \${arr[2]} done EOS --- above ssh value is shown properly echo 1 loop value is also shown properly but echo 2= is coming as blank i am not even using the variable.. the same ${arr[2]} is working before ssh but not working in ssh statements. any idea guys? |
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|