Sponsored Content
Full Discussion: If loop query
Top Forums UNIX for Beginners Questions & Answers If loop query Post 302994524 by JSKOBS on Friday 24th of March 2017 02:27:54 AM
Old 03-24-2017
If loop query

Hi, its getting aborted with below IF loop, can plz guide me what im missing here

Code:
        if [ -z "${APPEND}" ] || [ $($APPEND+1) % 3 -eq 0 ]; then
                echo "print $APPEND"
        fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Simple loop query

Hi All Just started with shell scripts and am stumped by, what is to most of you no doubt, a simple issue. All I'm trying to do is prompt a user for input and writing to a log file. If the user types the word 'stop', then the program should halt. If the word typed is 'clear', then the log file... (2 Replies)
Discussion started by: kutz13
2 Replies

2. Shell Programming and Scripting

Dynamic update loop query on Sybase database

Hello Guys, I'm new to Shell scripting, and i need someone to help me with this issue: I'm trying to do a dynamic update query on Sysbase database table using shell script. Lets say, the Update query is "update Table set id=X" , where X is dynamic value for the loop index. If the loop is... (10 Replies)
Discussion started by: Alaeddin
10 Replies

3. Shell Programming and Scripting

Query regarding for loop.

Filename.txt My First Line My Second Line ::::While Loop::: Program: while read line do echo "$line" done < Filename.txt output: My First Line My Second Line Is it possible to use for loop to get the same output. I have tried executing below code but i get every word of my file... (8 Replies)
Discussion started by: pinga123
8 Replies

4. Shell Programming and Scripting

SQL query in a loop with single sqlplus connection

Hi, I'm trying to build a shell script that reads a set of accounts from a file. For each account I need to perform a set of sql queries. So I have a loop with a set of sqlplus connections to retrieved my data. Is it possible to have a single sqlplus connection before entering the loop and... (4 Replies)
Discussion started by: lsantacana
4 Replies

5. Shell Programming and Scripting

Need help to run query in loop for all acct nbr in a file..

I have a txt file with contents of acct nbr's like: 22222222222 33333333333 33445566778 I need to write a script which takes each acct nbr in the file and run the query like: select seq_nbr from event where acct_nbr='22222222222' and the query's output should be passed to a... (0 Replies)
Discussion started by: Rajesh Putnala
0 Replies

6. Shell Programming and Scripting

Need help to run query in loop for all acct nbr in a file..

I have a txt file with contents of acct nbr's like: 22222222222 33333333333 33445566778 I need to write a script which takes each acct nbr in the file and run the query like: select seq_nbr from event where acct_nbr='22222222222' and the query's output should be passed to a... (2 Replies)
Discussion started by: Rajesh Putnala
2 Replies

7. Shell Programming and Scripting

Query regarding the if loop

Hi friends, One of my shell program(test.ksh) contains the following if loop.Can anyone please explain me how this loop will work The shell script will be executed as test.ksh -d all The value of variables are user=all opt=-d if && then && _del_all_w=1 || _group="${1}"... (1 Reply)
Discussion started by: kavithakuttyk
1 Replies

8. Shell Programming and Scripting

awk loop - substr and sub query

Hi there Looking for help with formating text output. I have following file 1ABC1234567890123Y 31-Jul-2012 1DEF1234567890124NMEDIUM 31-Jul-2012 193939312345889 YSMALL 31-Jul-2012 10093939312345889YSMALL 31-Jul-2012 1 YSMALL 31-Jul-2012 ... (14 Replies)
Discussion started by: viallos
14 Replies

9. Shell Programming and Scripting

Infinite loop query

I have a script script.shwhich is scheduled to run at 11 AM everyday. # script.sh Code: ./scb_script.sh & unfortunately scb_script.sh is running today in infinite loop as respective files are not available. My question, when script.sh starts running tomorrow, will the old process be... (1 Reply)
Discussion started by: JSKOBS
1 Replies

10. Shell Programming and Scripting

For loop query...

Hi all... I am using a for loop for another part of AudioScope... Consider this code:- for n in {0..100} do if }" = "another_string" ] then break fi done This works perfectly except I am not sure if breaking out of a 'for' loop might cause... (2 Replies)
Discussion started by: wisecracker
2 Replies
IMAP::Admin(3)						User Contributed Perl Documentation					    IMAP::Admin(3)

NAME
Cyrus::IMAP::Admin - Cyrus administrative interface Perl module SYNOPSIS
use Cyrus::IMAP::Admin; my $client = Cyrus::IMAP::Admin->new('mailhost'[, $flags]); $rc = $client->create('user.auser'[, $partition]); $rc = $client->delete('user.auser'); $rc = $client->deleteacl('user.buser', 'user1', 'user2'); %acls = $client->listacl('user.buser'); @mailboxes = $client->list('*'); @mailboxes = $client->list('%', 'user.'); @mailboxes = $client->subscribed('*'); %quota = $client->quota($root); ($root, %quota) = $client->quotaroot($mailbox); $rc = $client->rename($old, $new[, $partition]); $rc = $client->setacl($mailbox, $user =E<gt> $acl[, ...]); $rc = $client->setquota($mailbox, $resource =E<gt> $quota[, ...]); $rc = $client->xfer($mailbox, $server[, $partition]); DESCRIPTION
This module is a Perl interface to Cyrus administrative functions. It is used to implement Cyrus::IMAP::Admin::Shell (otherwise known as cyradm and also available for use in Perl administrative programs. METHODS
Many of the methods have a cyradm-compatible name and a shorter name. The shorter name is shown in the synopsis when it exists; the cyradm-compatible name should be reasonably obvious. In general, methods return undef or empty lists on error. In some cases a method may return an empty list without an error (i.e. "list" of a nonexistent hierarchy), so it may be necessary to check the error state explicitly via the "error" method. new($server[, $flags]) Instantiates a cyradm object. This is in fact an Cyrus::IMAP object with a few additional methods, so all Cyrus::IMAP methods are available if needed. (In particular, you will always want to use the "authenticate" method.) error Return the last error that occurred, or undef if the last operation was successful. This is in some cases (such as "list") the only way to distinguish between a successful return of an empty list and an error return. Calling "error" does not reset the error state, so it is legal to write: @folders = $cyradm->list($spec); print STDERR "Error: ", $cyradm->error if $cyradm->error; createmailbox($mailbox[, $partition]) create($mailbox[, $partition]) Create a new mailbox on the specified or default partition. deletemailbox($mailbox) delete($mailbox) Delete a mailbox. As with cyradm, you will probably need to add the c ACL for yourself to the mailbox with "setaclmailbox" first. deleteaclmailbox($mailbox, $user[, ...]) deleteacl($mailbox, $user[, ...]) Delete one or more ACL from a mailbox. listaclmailbox($mailbox) listacl($mailbox) Returns a hash of mailbox ACLs, with each key being a Cyrus user and the corresponding value being the ACL. listmailbox($pattern[, $reference]) list($pattern[, $reference]) List mailboxes matching the specified pattern, starting from the specified reference. The result is a list; each element is an array containing the mailbox name, attributes, and the separator. (This interface may change.) listsubscribed($pattern[, $reference]) subscribed($pattern[, $reference]) Like "listmailbox" but only shows subscribed mailboxes. listquota($root) quota($root) Returns a hash specifying the quota for the specified quota root. Use "listquotaroot" to find the quota root for a mailbox. listquotaroot($mailbox) quotaroot($mailbox) Returns a list, the first element is the quota root for the mailbox and remaining elements are a hash specifying its quota. renamemailbox($from, $to[, $partition]) rename($from, $to[, $partition]) Renames the specified mailbox, optionally moving it to a different partition. setaclmailbox($mailbox, $user => $acl[, ...]) setacl($mailbox, $user => $acl[, ...]) Set ACLs on a mailbox. The ACL may be one of the special strings "none", "read" ("lrs"), "post" ("lrsp"), "append" ("lrsip"), "write" ("lrswipkxte"), "delete" ("lrxte"), or "all" ("lrswipkxte"), or any combinations of the ACL codes: l Lookup (mailbox is visible to LIST/LSUB, SUBSCRIBE mailbox) r Read (SELECT/EXAMINE the mailbox, perform STATUS) s Seen (set/clear SEEN flag via STORE, also set SEEN flag during APPEND/COPY/FETCH BODY[...]) w Write flags other than SEEN and DELETED i Insert (APPEND, COPY destination) p Post (send mail to mailbox) k Create mailbox (CREATE new sub-mailboxes, parent for new mailbox in RENAME) x Delete mailbox (DELETE mailbox, old mailbox name in RENAME) t Delete messages (set/clear DELETED flag via STORE, also set DELETED flag during APPEND/COPY) e Perform EXPUNGE and expunge as part of CLOSE a Administer (SETACL/DELETEACL/GETACL/LISTRIGHTS) setquota($mailbox, $resource, $quota[, ...]) Set quotas on a mailbox. Note that Cyrus currently only defines one resource, "STORAGE". As defined in RFC 2087, the units are groups of 1024 octets (i.e. Kilobytes) xfermailbox($mailbox, $server[, $partition]) xfer($mailbox, $server[, $partition]) Transfers (relocates) the specified mailbox to a different server. AUTHOR
Brandon S. Allbery, allbery@ece.cmu.edu SEE ALSO
Cyrus::IMAP Cyrus::IMAP::Shell perl(1), cyradm(1), imapd(8). perl v5.16.3 2012-12-01 IMAP::Admin(3)
All times are GMT -4. The time now is 10:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy