Search Results

Search: Posts Made By: jagpreetc
1,309
Posted By jagpreetc
Thanks for the reply. eval did the trick. ...
Thanks for the reply.

eval did the trick.

Thanks anyway
1,309
Posted By jagpreetc
Runtime variable extraction
Hi There,

var1=value1
var2=value2
var3=value3

for (( i=1; i<4; i++ ))
do
temp=var$i
echo "$temp"
done

OUTPUT
var1
var2
var3

I want the output to be
value1
value2
1,419
Posted By jagpreetc
thanks again ahamed. I could manage to make...
thanks again ahamed.

I could manage to make it work to some extent.....

Except how do I handle default case in here.
It can be used with *) in case - esac

I mean executing a function in...
1,419
Posted By jagpreetc
thanks for reply ahamed. first of all bash...
thanks for reply ahamed.

first of all bash version
GNU bash, version 3.00.16(1)-release (sparc-sun-solaris2.10)

After assigning all the array fields.

whatever keypress entered it takes last...
1,419
Posted By jagpreetc
Case vs array
Hi Gurus,

Is there a way to replace case -- esac with an array

while [ 1 ] ; do
read key_press ;
case $key_press in
p|P)
fun_P
;;
t|T)
...
1,857
Posted By jagpreetc
Hey DON, Thx for reply. Its a cdr file so...
Hey DON,
Thx for reply.

Its a cdr file so fields are mix of string and numbers.

I figured out the solution just now.

Its the blank line after every data line which was screwing the result....
1,857
Posted By jagpreetc
Nawk help
I don't know whats wrong with the code here.


Its giving double counts.


nawk -F# '
{

if( match($2, "= ") > 0)
num=substr($2,RSTART+2,length($2)-1);

...
1,157
Posted By jagpreetc
Thanks Chihung, It does work except for the...
Thanks Chihung,

It does work except for the fact which I didn't mention that

$a $b are multiple words | separated.

as grep can be used for searching multiple words
grep "aa|bb|cc" file
...
1,157
Posted By jagpreetc
case use instead of if else
Hi,
I'm writing a script where the requirement is of the sort
if echo $x | grep $a > /dev/null
then
COLOR1
elif echo $x | grep $b > /dev/null
then
COLOR2
..
..
fi

I want to replace this...
1,961
Posted By jagpreetc
Its working.
Thanks Guru,

Its working.
Its just, the output is dependent on user user input for cumulative report or hourly report but a single "if" did the trick for me.

I was just wondering if I can...
1,961
Posted By jagpreetc
Hi Guru, ya its multiple a.txt files every hour...
Hi Guru,
ya its multiple a.txt files every hour
e.g.
a_2010062400.txt
a_2010052401.txt

I need the cumulative output

e.g. a_2010062400.txt contains

128655 39 28
127655 96 28
127655 ...
1,961
Posted By jagpreetc
retaining awk array in shell
Is there a way to retain the awk array in the shell.

My requirement

file a.txt

A B Count
10 1 25
10 2 20
10 3 21
11 1 20
11 ...
Showing results 1 to 12 of 12

 
All times are GMT -4. The time now is 05:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy