I have a script that facillitates NDM (Connect::\Direct) transfer to remote hosts. This script uses getopts to parse through the parameters passed to it and to set appropriate variables based upon what was passed in.
Kickoff="mv $PATH/$FILE1 $PATH/$FILE2"
ndm_shell.ksh -p $Node -s $Source -d... (3 Replies)
I need to parse parameters but the arguments could be NULL,example:
> cat getopts.sh
while getopts "a:b:" opt 2>/dev/null
do
case "${opt}" in
a) echo "A:${OPTARG}" ;;
b) echo "B:${OPTARG}" ;;
*) exit 1 ;;
esac
done
> getopts.sh -a TEST1 -b TEST2... (5 Replies)
Hi
i have part of the scripts below ,getopt for -h or ? not working for me.
can anybody tell me if this sytax right or wrong.
#!/usr/bin/ksh
program=$(basename $0)
#####################################################################################
function usageerr
{
RC=1
... (3 Replies)
Hi, I am a new member to unix.com.
Actually I am facing a problem with getopts. In my script i have used getopts to parse the parameters. when i use the script as shown below its working fine:
find_status -p all ### where find_status is a script name.
But even if I pass more than one... (3 Replies)
i was going through the man page of getopts
this particular section is not clear to me can anyone please
clarify in a little detail so that i can understand the concept
MANPAGE::
Since getopts affects the current shell execution environ-
ment, it is generally provided as a... (7 Replies)
How do I get the getopts command to display whats written at my help option if no option is types in? For example,
myscript.sh -h
will bring up my help option, however, I also want
myscript.sh
to do the same!
#!/bin/bash
while getopts :abh opt
do case "$opt" in... (2 Replies)
Hi everyone
I want to know how can we pass multiple argument in getopts
suppose
PARAMS="abcd"
while getopts ${PARMS} FLAG
do
case ${FLAG} in
(a)
(b)
(c)
(d)
esac (6 Replies)
In the below code
while getopts :rfw:d:s:a: options
do
case "$options" in
r) echo reverse;;
f) echo forward;;
w) window=$OPTARG;;
d) duration=$OPTARG;;
s) search=$OPTARG;;
a) value=$OPTARG;;
*) help; exit;;
esac
done
... (2 Replies)
can anyone spot a problem with the below:
$
$ cat getopts.sh
#!/bin/sh
usage() { echo "myscript.sh local /tmp data.txt 600s -query" 1>&2; exit 1; }
while... (4 Replies)
Discussion started by: SkySmart
4 Replies
LEARN ABOUT PHP
imap_get_quota
IMAP_GET_QUOTA(3) 1 IMAP_GET_QUOTA(3)imap_get_quota - Retrieve the quota level settings, and usage statics per mailboxSYNOPSIS
array imap_get_quota (resource $imap_stream, string $quota_root)
DESCRIPTION
Retrieve the quota level settings, and usage statics per mailbox.
For a non-admin user version of this function, please see the imap_get_quotaroot(3) function of PHP.
PARAMETERS
o $
imap_stream -An IMAP stream returned by imap_open(3).
o $quota_root
-$quota_root should normally be in the form of user.name where name is the mailbox you wish to retrieve information about.
RETURN VALUES
Returns an array with integer values limit and usage for the given mailbox. The value of limit represents the total amount of space
allowed for this mailbox. The usage value represents the mailboxes current level of capacity. Will return FALSE in the case of failure.
As of PHP 4.3, the function more properly reflects the functionality as dictated by the RFC2087. The array return value has changed to
support an unlimited number of returned resources (i.e. messages, or sub-folders) with each named resource receiving an individual array
key. Each key value then contains an another array with the usage and limit values within it.
For backwards compatibility reasons, the original access methods are still available for use, although it is suggested to update.
EXAMPLES
Example #1
imap_get_quota(3) example
<?php
$mbox = imap_open("{imap.example.org}", "mailadmin", "password", OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
$quota_value = imap_get_quota($mbox, "user.kalowsky");
if (is_array($quota_value)) {
echo "Usage level is: " . $quota_value['usage'];
echo "Limit level is: " . $quota_value['limit'];
}
imap_close($mbox);
?>
Example #2
imap_get_quota(3) 4.3 or greater example
<?php
$mbox = imap_open("{imap.example.org}", "mailadmin", "password", OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
$quota_values = imap_get_quota($mbox, "user.kalowsky");
if (is_array($quota_values)) {
$storage = $quota_values['STORAGE'];
echo "STORAGE usage level is: " . $storage['usage'];
echo "STORAGE limit level is: " . $storage['limit'];
$message = $quota_values['MESSAGE'];
echo "MESSAGE usage level is: " . $message['usage'];
echo "MESSAGE limit is: " . $message['limit'];
/* ... */
}
imap_close($mbox);
?>
NOTES
This function is currently only available to users of the c-client2000 or greater library.
The given $imap_stream must be opened as the mail administrator, otherwise this function will fail.
SEE ALSO imap_open(3), imap_set_quota(3), imap_get_quotaroot(3).
PHP Documentation Group IMAP_GET_QUOTA(3)