Sponsored Content
Full Discussion: while - loop does not work
Top Forums Shell Programming and Scripting while - loop does not work Post 302406884 by xcitan on Wednesday 24th of March 2010 05:50:59 AM
Old 03-24-2010
Tools while - loop does not work

Hey guys,

maybe you can help me.. what am i doing wrong?
Why this doesn`t work in ksh.

Code:
        while [ "${decision}" != "y"  ||  "${decision}" != "n" ]
        do
        echo "Type y or n"
        read decision
                if [ "${decision}" = "y" ]
                then
                doInstall
                fi
        done

i also tried this

Code:
        while [ "${decision}" != "y" ] || [ "${decision}" != "n" ]
        do
        echo "Type y or n"
        read decision
                if [ "${decision}" = "y" ]
                then
                doInstall
                fi
        done

I want the loop to be endet as soon as the user types in y or n.
But it just doesnt end.

Thanks a lot in advance.

Regards
xcitan
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Why script For...Loop doesn't work. Seek help

I have written a script to run on UNIX server. When I tested, it always hanged on after "date +"%D %T: XXXXXX script started." part. Then it wouldn't go further. UNIX server gave me one error message. I used the same code in another script. It works fine. I think the major problem may be in... (3 Replies)
Discussion started by: duke0001
3 Replies

2. UNIX for Dummies Questions & Answers

The loop that dosent work

I have a serious problem and Im sure im just doing something stupid ######Start Load while do /export/home/mldwh/rkem_refresh/int_load/scripts/rkem_refresh.sh sleep 10 while do sleep 5 done done ######Log and Runstats sleep... (12 Replies)
Discussion started by: jadionne
12 Replies

3. Shell Programming and Scripting

Work CSV file with awk loop

I need to converts a CSV file from Format "A" into Format "B", where the first field is repeated in a loop with a counter. I'am quite sure that this is with AWK possible burt the "Forum Search Function" doesn't work at the moment. Format "A" A1;B1 ;B2 ;B3 A2;C1 ;C2 ;C3 ... (2 Replies)
Discussion started by: frieling
2 Replies

4. Shell Programming and Scripting

for loop doesn't work

I have a script which uses below for loop: for (( i = 0 ; i <= 5; i++ )) do echo "Welcome $i times" done But when I run the script, it gives error message: Syntex Error : Bad for loop variable Can anyone guide to run it? Thanks in advance. (10 Replies)
Discussion started by: naw_deepak
10 Replies

5. UNIX for Dummies Questions & Answers

Top level TCSH while Loop doen't work

Hey guys... I'm learning some shell scripting on OS X using the tcsh shell. For some reason... my while loop isn't executing right (or more likely I am doing something wrong.) Something as simple as this doesn't work: #!/bin/tcsh set g = 0 while ($g <10) echo "this" $g @ g =... (2 Replies)
Discussion started by: sprynmr
2 Replies

6. Shell Programming and Scripting

loop doesnt work

It just does the break...even though the files are not the same... # Compare extracts #========================================== count=0 while (( count < 5 )) do (( count+=1 )) echo "Try $count" file1=$(ls -l /tmp/psjava.xml|... (5 Replies)
Discussion started by: sigh2010
5 Replies

7. Shell Programming and Scripting

tail -XXX with grep doesn't work in while loop

Hi all, I need some help. my shell script doesn't work especially in the loop. #!/bin/sh -xv export ORA_ADMIN=/oracle/home/admin export ORACLE_SID=ORA_SID cat ${ORA_ADMIN}/param_alert_log.ora | while read MSG do #echo $MSG #echo "tail -400... (8 Replies)
Discussion started by: sidobre
8 Replies

8. Shell Programming and Scripting

Why does my for loop does not work right in ksh?

hi all, i have a for loop statement in my ksh code. it only returns the first value retrieved not the value for the other rows. ex: acct_id value = returned value in the for loop 1 = 1 2 = 1 (instead of 2) 3 = ... (1 Reply)
Discussion started by: ryukishin_17
1 Replies

9. Shell Programming and Scripting

Script doesn't work in loop but does if not

I have a script that only works if I remove it from the looping scenario. #!/bin/bash # Set the field seperator to a newline ##IFS=" ##" # Loop through the file ##for line in `cat nlist.txt`;do # put the line into a variable. ##dbuser=$line echo "copying plugin..." ... (6 Replies)
Discussion started by: bugeye
6 Replies

10. Shell Programming and Scripting

Why doesnt if inside a while loop work ?

I am looping through a file in bash and performing some operations on it. Here is the code. cat test.dat - One Two Three Case 1: With if inside while loop Output: One file found :) ------------------ isn't it supposed to print following output !!! one (3 Replies)
Discussion started by: qwarentine
3 Replies
avc_cache_stats(3)					     SELinux API documentation						avc_cache_stats(3)

NAME
avc_cache_stats, avc_av_stats, avc_sid_stats - obtain userspace SELinux AVC statistics. SYNOPSIS
#include <selinux/selinux.h> #include <selinux/avc.h> void avc_av_stats(void); void avc_sid_stats(void); void avc_cache_stats(struct avc_cache_stats *stats); DESCRIPTION
The userspace AVC maintains two internal hash tables, one to store security ID's and one to cache access decisions. avc_av_stats and avc_sid_stats produce log messages indicating the status of the access decision and SID tables, respectively. The mes- sages contain the number of entries in the table, number of hash buckets and number of buckets used, and maximum number of entries in a single bucket. avc_cache_stats populates a structure whose fields reflect cache activity: struct avc_cache_stats { unsigned entry_lookups; unsigned entry_hits; unsigned entry_misses; unsigned entry_discards; unsigned cav_lookups; unsigned cav_hits; unsigned cav_probes; unsigned cav_misses; }; entry_lookups Number of queries made. entry_hits Number of times a decision was found in the aeref argument. entry_misses Number of times a decision was not found in the aeref argument. entry_discards Number of times a decision was not found in the aeref argument and the aeref argument was non-NULL. cav_lookups Number of cache lookups. cav_hits Number of cache hits. cav_misses Number of cache misses. cav_probes Number of entries examined while searching the cache. NOTES
When the cache is flushed as a result of a call to avc_reset or a policy change notification, the statistics returned by avc_cache_stats are reset to zero. The SID table, however, is left unchanged. When a policy change notification is received, a call to avc_av_stats is made before the cache is flushed. AUTHOR
Eamon Walsh <ewalsh@tycho.nsa.gov> SEE ALSO
avc_init(3), avc_has_perm(3), avc_context_to_sid(3), avc_add_callback(3) selinux(8) 27 May 2004 avc_cache_stats(3)
All times are GMT -4. The time now is 07:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy