10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
Can you please help me with the below.
#!/bin/bash
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1"
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies
2. Shell Programming and Scripting
Hi all,
I can’t resolve an array element access issue on (Linux/pdksh) .. So I’m positing for advice.By the way - a friend demonstrated to me - same script works as expected under Solaris.
I have been working on a documentation project where many *.jpg screen shots are used in the... (4 Replies)
Discussion started by: njdpo
4 Replies
3. Shell Programming and Scripting
hi all, i've a requirement like this.
i want to access the contents of an array declared in one script,which is a bash script, to a second script which is a perl script.
actually i want a sort of global variable which can be accessed in other script
like environmen variables and also i can... (3 Replies)
Discussion started by: tprayush
3 Replies
4. Shell Programming and Scripting
Hi,
I want to access a variable outside the awk program. My program is as below:- I can not access the exact value of k (See the last line of the program).
#!/usr/bin/sh
j=10
k=1
#k is declared outside awk
awk '
BEGIN {
i=1;
j1="'"$j"'"
printf("\n ## Value of j1 is %d ##", j1);
... (2 Replies)
Discussion started by: shouvik.mitra
2 Replies
5. Shell Programming and Scripting
Hi,
My doubt is how to access array elements..
Situation is as below:
#!/bin/ksh
set -x
typeset -i x=0
typeset -i y=0
typeset -i BID=0
typeset -i count=0
while ] ; do
x=`expr $x + 1`;
hwmgr show scsi > scsi.tmp
while read line; do
set... (1 Reply)
Discussion started by: mansa
1 Replies
6. Shell Programming and Scripting
I am trying to pass a shell array I created to match on values amongst other things.
I have a sample:
#! /bin/ksh
i=0
for id in `cat id.lst`
do
IDs=$id
(( i=i+1 ))
done
cat sqloutput.txt | awk -F, -v ids=$ID '{
# Do stuff
}'
But it looks as if I cannot do this.... (1 Reply)
Discussion started by: Zombywoof
1 Replies
7. Shell Programming and Scripting
How do I access one of the indices in array tst with the code below?
tst=sprintf("%5.2f",Car / 12)
When I scan thru the array with
for ( i in tst ) { print i,tst }
I get the output of:
vec-7 144
But when I try this in the END
print tst
It looks like it's not set.
What am... (6 Replies)
Discussion started by: timj123
6 Replies
8. Shell Programming and Scripting
As per title and much apprecieated! (2 Replies)
Discussion started by: biglau
2 Replies
9. Shell Programming and Scripting
Hello,
I wonder if it is possible to pass and use variables from shell environment into sed or awk. I am trying to achieve something similar to the following using sed or awk:
var=some_regular_expression
grep "$var" filename # Will extract lines from filename
The following code,... (3 Replies)
Discussion started by: nasersh
3 Replies
10. Shell Programming and Scripting
Hello everyonel,
I have an array set like so
num=4
read name
arr=name
I go through while loop to assign different values to different array element from 1 to 4. when I try to access the FIRST element of the array I get the last one first. Like if I say ${arr} it will show the last element... (4 Replies)
Discussion started by: afadaghi
4 Replies