Thanks a lot man! Fantastic! It worked! Could you kindly explain the code? I'm ignorant And also I just wanted how I can change array elements using sed within a loop. May be like this-
Thanks a lot! Really appreciate it!
Last edited by saleheen; 01-29-2015 at 02:23 PM..
Reason: Just adding some lines
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}\n"
(( j = j + 1 ))
j=`expr j+1`
done
EOS
# END
=========
this is not giving me correct output.
I... (5 Replies)
hi All,
I have a array as follows,
array1=("xx" "abc" "def" "xyz")
and each array1 is also storing some array values, like
array1=abc
and abc=("a" "b" "c") etcetera etcetra.........
Note : each subarray under array1 have index 3 i.e. it can max contain 3 values
if i echo ${abc} ... (5 Replies)
I want to run an awk split on a value that has been pushed through an array and I was wondering what the syntax should be??
e.g. running time strings through an array and trying to examine just minutes:
12:25:30
10:15:13
08:55:23
awk '
NR==FNR{
... (2 Replies)
Hi All,
I have the following code sequence for reading some bulk file and moving the content to two different arrays.
while read data
do
THREEG_PATTERN=`echo $data | egrep "3G"`
if
then
NEW_THREEG_PATTERN=`echo $THREEG_PATTERN | cut -d " " -f2`
... (12 Replies)
I have a array as
CArray=( a1 a2 )
and a1,a2,a3 are also array as:
a1=(1 2 3)
a2=(3 4 5)
now I have this in my code:
for i in `echo "${CArray}"`
do
echo ${$i}
done
It is giving error as :"bad substitution"
It should give me value as
1 2 3
3 4 5
how can I get this...Can u please... (2 Replies)
Hello I have the file df.tmp
FS is actually the / FS but escape character\ and end of line $ is used in order to fetch exctly / and not other filesystems.
awk '/\/$/ {print $(NF-1)+0}' df.tmp will work properly and return a value eg. 60
but when I am trying to issue the command with the array... (3 Replies)
I have a file
root@server # cat /root/list12
11.22.33.44
22.33.44.55
33.44.55.66
33.44.55.66
33.44.55.66
I try to pass to array and display unique.
root@server# cat /root/test12.sh
#!/bin/bash
#delcare array badips and accumulate values to array elemenrs
badips=( $( cat... (4 Replies)
I tried to use variable inside an array variable, but its not working as expected.:wall:
ENV1=123
ENV1=789
ENV1=120
ENV2=567
if
then
name=ENV1
echo "${name}"
echo "${name}"
echo "${name}"
else
name=ENV1
echo "${name}"
fi
Output: ./val.sh 1
123 (2 Replies)
The requirement is i need to find an array value matching with pattern {5:{ , replace that with 5: and reassign that to same array index and print it.
I write something like below and the issue is sed command is not working. If i replace " with "`" the script gives syntax error.how can i... (8 Replies)