chkcount variable in bash reserved?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting chkcount variable in bash reserved?
# 1  
Old 12-08-2008
chkcount variable in bash reserved?

Hi,
im experiencing a really strange thing:
_____________________________
#!/bin/bash

chkcount=0
chkcountmax=3

while ((chkcount < chkcountmax))
do
echo "chkcount=$chkount"
echo "chkcountmax=$chkountmax"
((chkcount++))
done
---------------------------------------------------------------
this results in and endlessloop...

if if replace chkcount with count, it works...

is there something special about the chkcount variable?
i got an RHEL 5.2 running, maybe that is the issue?

thanks
# 2  
Old 12-08-2008
Quote:
Originally Posted by tho99
Code:
#!/bin/bash

chkcount=0
chkcountmax=3

while ((chkcount < chkcountmax))
do
        echo "chkcount=$chkount"
        echo "chkcountmax=$chkountmax"
        ((chkcount++))
done

Keep learning, read bash manual and watch for typo
Use [code] tags when you post code or data sample
Code:
#!/bin/bash

chkcount=0
chkcountmax=3

while (( $chkcount < $chkcountmax))
do
        echo "chkcount=$chkcount"
        echo "chkcountmax=$chkcountmax"
        ((chkcount++))
done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Variable in bash help

#aa=xxxx #zz="cc $aa" #aa=gggg #echo $zz out put is cc xxxx if I want to get cc gggg how should I do, I don't want to write zz="c $aa " after aa=gggg (2 Replies)
Discussion started by: yanglei_fage
2 Replies

2. Shell Programming and Scripting

Use variable in bash

$ p="1 2 5 8" $ set -- $p $ echo $3 5 $ k=3 $ echo \$${k} $3 I want the "echo \$${k}" to get the output 5 , how to modify ? (6 Replies)
Discussion started by: yanglei_fage
6 Replies

3. AIX

Question about reserved memory

Hi! maybe a stupid question but i recall fixing this issue before (or something similar), On one of my frames I have a huge amount of reserved memory. 25GB to be exact. I am running out of memory and need to add a new lpar. I can't remember exactly how i fixed this issue before and it's... (2 Replies)
Discussion started by: vpundit
2 Replies

4. Solaris

/dev/rmt/0mn: write protected or reserved

# mt stat HP DDS-4 DAT (Sun) tape drive: sense key(0x0)= No Additional Sense residual= 0 retries= 0 file no= 0 block no= 0 mt -f /dev/rmt/0mn erase /dev/rmt/0mn: write protected or reserved. Getting error while ufsdump .... --- Dumping / to /dev/rmt/0mn --- DUMP: Date... (5 Replies)
Discussion started by: vickyingle5
5 Replies

5. Hardware

/dev/rmt/0mn: write protected or reserved

# mt stat HP DDS-4 DAT (Sun) tape drive: sense key(0x0)= No Additional Sense residual= 0 retries= 0 file no= 0 block no= 0 mt -f /dev/rmt/0mn erase /dev/rmt/0mn: write protected or reserved. Getting error while ufsdump .... --- Dumping / to /dev/rmt/0mn --- DUMP: Date... (1 Reply)
Discussion started by: vickyingle5
1 Replies

6. Shell Programming and Scripting

bash - Variable made of variable

Hello, I am struggling with using variable made using "eval". a=4 eval b$a=20 echo $b$a ??? As shown above, I am trying to call back the variable "bX" assuming I do not know the value of "a". How can I do that? I tried several combinations but nothing worked. Thanks (10 Replies)
Discussion started by: jolecanard
10 Replies

7. Shell Programming and Scripting

bash and ksh: variable lost in loop in bash?

Hi, I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh). The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
Discussion started by: estienne
2 Replies

8. Shell Programming and Scripting

passing variable from bash to perl from bash script

Hi All, I need to pass a variable to perl script from bash script, where in perl i am using if condition. Here is the cmd what i am using in perl FROM_DATE="06/05/2008" TO_DATE="07/05/2008" "perl -ne ' print if ( $_ >="$FROM_DATE" && $_ <= "$TO_DATE" ) ' filename" filename has... (10 Replies)
Discussion started by: arsidh
10 Replies

9. Shell Programming and Scripting

sed error - using reserved letters

Hi All, below is my data file file.txt 0 ServerA LAN1 AAA IT01 04/30/2008 09:16:26 (no records) 0 ServerB LAN1 AAA IT02 04/30/2008 09:16:26 0 ServerA LAN1 AAA IT01 04/30/2008 11:11:26 0 ServerB LAN1 AAA IT02 ... (6 Replies)
Discussion started by: karthikn7974
6 Replies

10. UNIX for Advanced & Expert Users

NFS and NIS reserved ports

Does anyone know how to assign rpc ports to NFS or NIS processes on Solaris please ? Thanks, Michael Chnader (0 Replies)
Discussion started by: mchnaider
0 Replies
Login or Register to Ask a Question