10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Need a help. I am just learning Shell scripting. Need a requirement like to attach variable to array values. Value of from is AF and to is AD.
froml=$(echo $from | tr '' '')
tol=$(echo $to | tr '' '')
Schemas=(AWQM WFCONTROLLER PROVCO PRISM)
for s in "${Schemas}"
do
... (3 Replies)
Discussion started by: pvmanikandan
3 Replies
2. Shell Programming and Scripting
I am new to ksh scripting, specially array. How do i get values from an array and set the value as variable and pass those variables to the different functions??
someone taught me how to get input from a file with have columns i need to read, but now i doesnt know how to set those value to be a... (7 Replies)
Discussion started by: gavin_L
7 Replies
3. Shell Programming and Scripting
Hi,
I need to update rows in a table based on the values in an array variable.
code is :
while read line
do
error_msg="$(echo $line)"
index=`expr $index+1`
done <"logs/$ffile"
rows_count=${#error_msg
}
i=0
while
do
echo "error msgs is... (2 Replies)
Discussion started by: RP09
2 Replies
4. Shell Programming and Scripting
Am using a find command in my script .The output may be one or more. I need to store those values in a array and need to access those. Am unable to find the solution . Any help on this will be helpful.
if
< code>
else a=<find command output which gives the file name either 1 or more>
if 1... (1 Reply)
Discussion started by: rogerben
1 Replies
5. Shell Programming and Scripting
Dear All,
I have been trying to do a simple task of extracting 2 fields from the file (3 rows) and store it in an array variable. I tried with:
#! /bin/bash
ch=`cut -f10 tmp.txt`
counter=0
for p in $pid
do
c=${ch}
echo "$c ..$counter"
counter=$((counter+1))... (2 Replies)
Discussion started by: ezhil01
2 Replies
6. Shell Programming and Scripting
Disclaimer: OP is 100% Awk beginner.
I use this code on ASCII files I need to report against.
awk 'BEGIN {
tokens = 0
tokens = 0
tokens = 0
}
{ for (token in tokens)
{ if ($1 == token){print $0; tokens++;}}}
END {for (token in tokens){
if( tokens ==... (1 Reply)
Discussion started by: alan
1 Replies
7. Shell Programming and Scripting
Hi I'm just learning programming and need some help.
I've taken a data file which has a list of numbers eg:
3
5
32
533
13
2
And I've used sort -n and to sort and then piped it to awk to arrange into an array.
#!/bin/sh
sort -n data.txt |
awk '
{
array=$1
} (4 Replies)
Discussion started by: EL_Chemso
4 Replies
8. Shell Programming and Scripting
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)
Discussion started by: joshilalit2004
2 Replies
9. Shell Programming and Scripting
hi all
I am using awk utility to parse the file and fetching two different vaues from two different record of a record set.
I am able to see the result, now i want to store the result and perform some check of each values form database to mark valid and invalid.
could you please help me... (3 Replies)
Discussion started by: singhald
3 Replies
10. Shell Programming and Scripting
i have these values inside variable $blah
BUNGA TERATAI 3 5055 ITH 1 0 0 0 1 1
JADE TRADER 143W ITH 4 0 0 0 4 4
MOL SPLENDOR 0307A ITH 3 0 0 0 3 3
so how do I split them into array with the... (4 Replies)
Discussion started by: finalight
4 Replies