Sponsored Content
Top Forums Shell Programming and Scripting Multiple conditionals in a while loop Post 302141381 by Ygor on Thursday 18th of October 2007 08:47:23 PM
Old 10-18-2007
Your logic is at fault. You want the loop to continue WHILE $life is not equal to zero AND $mask is not equal to $word.

De Morgan's laws - Wikipedia, the free encyclopedia

Last edited by Ygor; 10-18-2007 at 10:05 PM.. Reason: Added link.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ideas for perl script - strings,conditionals..etc

I have a matrix , how do I compare all the elements of a column , lets say I want to check if the columns contain the alphabets "S","H","A","R","A","T". and not "X"s. Lets say matrix looks something like this .. SSSXSH HHXXHA AAXXAT RRRXRS AAXTAR TTTTTA I can hard code it where... (4 Replies)
Discussion started by: sharatz83
4 Replies

2. Shell Programming and Scripting

Multiple Conditionals

Yet another question. I want to make something like this: if ||&& then ... fi but that apparently is not right. I want either the first condition to be true OR the second AND third conditions to be true for the "then" to be processed. How can I do this? (1 Reply)
Discussion started by: jeriryan87
1 Replies

3. Shell Programming and Scripting

Using arrays with conditionals

Pardon the pseudo code below, but I'm wondering how I would do something along the lines of this... #!/bin/sh excludeList="A B" theItem="C" if then echo $theItem fi I know I could loop through the array and check against each value, but was wondering if there was an alternate way... (1 Reply)
Discussion started by: myndcraft
1 Replies

4. Shell Programming and Scripting

Log successful unix conditionals

Dears, Can anyone advise how to log successful conditionals (unix commands) from any ksh script? For example, the code is as follows: if <command> then Block1 of statements else Block2 of statements fi What needed exactly is to log "Block1 of statements" if its conditon is met.... (4 Replies)
Discussion started by: kadi
4 Replies

5. Shell Programming and Scripting

mysql help : query with 2 conditionals

Hi there, I have a table that stores multiple records for many different servers, each of which is timestamped ... I wanted to write a query that would enable me to only output the "latest" record (based on timestamp) for each "unique" server. So for example my main table looks like this ... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

6. Shell Programming and Scripting

Reset while loop to loop same file multiple times

Hi, I want to read file multiple times. Right now i am using while loop but that is not working. ex. While read line do while read line2 do echo stmt1 #processing some data based on data., done < file2.txt done < file1.txt # This will have 10... (4 Replies)
Discussion started by: tmalik79
4 Replies

7. Shell Programming and Scripting

Script no conditionals

Hello, pro scripters, noob here, I am complete noob in this and I have to write a program which: Calculates the modulus of two numbers which the user enters with keyboard. Number interval 1-9. These two numbers that were entered and modulus which was calculated are stored in a separate file.... (1 Reply)
Discussion started by: IrmantasID
1 Replies

8. Programming

Gnu make: default values and conditionals

I need some help. I use variables and conditionals to build with or without specic libraries. I set USEAL ?= 1 # get value from cmd, defaults to 1 (see comment) the conditional is: ifeq ($(USEAL),1) LIBS = <any libs> else LIBS = endif Its amazing that this works when invoked... (4 Replies)
Discussion started by: dodona
4 Replies
URI::URL(3)						User Contributed Perl Documentation					       URI::URL(3)

NAME
URI::URL - Uniform Resource Locators SYNOPSIS
$u1 = URI::URL->new($str, $base); $u2 = $u1->abs; DESCRIPTION
This module is provided for backwards compatibility with modules that depend on the interface provided by the "URI::URL" class that used to be distributed with the libwww-perl library. The following differences exist compared to the "URI" class interface: o The URI::URL module exports the url() function as an alternate constructor interface. o The constructor takes an optional $base argument. The "URI::URL" class is a subclass of "URI::WithBase". o The URI::URL->newlocal class method is the same as URI::file->new_abs. o URI::URL::strict(1) o $url->print_on method o $url->crack method o $url->full_path: same as ($uri->abs_path || "/") o $url->netloc: same as $uri->authority o $url->epath, $url->equery: same as $uri->path, $uri->query o $url->path and $url->query pass unescaped strings. o $url->path_components: same as $uri->path_segments (if you don't consider path segment parameters) o $url->params and $url->eparams methods o $url->base method. See URI::WithBase. o $url->abs and $url->rel have an optional $base argument. See URI::WithBase. o $url->frag: same as $uri->fragment o $url->keywords: same as $uri->query_keywords o $url->localpath and friends map to $uri->file. o $url->address and $url->encoded822addr: same as $uri->to for mailto URI o $url->groupart method for news URI o $url->article: same as $uri->message SEE ALSO
URI, URI::WithBase COPYRIGHT
Copyright 1998-2000 Gisle Aas. perl v5.12.1 2008-04-04 URI::URL(3)
All times are GMT -4. The time now is 01:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy