This script works.. But I am not sure why its working..
I thought [ -n string ] is supposed to check for zero length string. But in my case even a uninitialized variable has 1 byte length..
Can someone explain why every empty variable has following bytes? with byte length 1.?
Last edited by kchinnam; 05-19-2010 at 10:31 PM..
Reason: elaboration
How to write this condition in ksh?
if myfile is empty or myfile does not exist
then
do action1
fi
is this OK?
if ] -o ] then
then
do action1
fi
Thanks. (3 Replies)
Hi,
Plz suggest me how can i change the date of a file.
Suppose my file has been created in some date and i want to give it present date.
How can i do this???? (2 Replies)
hi all,
i want use the variable value as a new variable name. print output of new variable.
for i in COMPUTER1 COMPUTER2
do
flag_name=${i}_FLAG
eval ${flag_name}=123
echo $i'_FLAG'
done
output is
COMPUTER1_FLAG
COMPUTER2_FLAG
i need output as
123
123 (2 Replies)
Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for.
Anyway, I'm in the process of self-teaching... (1 Reply)
Hi.
How to change string variable in awk?
for example, I parse with awk script text file named some_name_with_extension.txt
I want to print only some_name in my script
....
varCompName = FILENAME
print varCompName
How to put not all symbols from FILENAME to variable?
thank you
This... (4 Replies)
Hey Guys,
I have text such as this.
28003,ALCORN,2
28009,BENTON,2
28013,CALHOUN,2
28017,CHICKASAW,2
47017,CARROLL,2
05021,CLAY,0
The last digit after the final "," is a variable value. This is the base file. I have to do further execution on this file later and I need to update the... (7 Replies)
I feel like it is just a matter of using the $ operators correctly, but I can't seem to get it...
hostname="network"
ip="192.168.1.1"
netmask=""
variables=( $hostname $ip $netmask )
for var in ${variables}
do
if ; then
$var="--"
fi
done
echo... (7 Replies)
Hi,
This is the first time I see something like this, and I don't why it happens.
Please give me some help. I am really appreciate it.
Basically I am trying to remove all empty lines of an input..
#!/bin/bash
set -e
set -x
str1=`echo -e "\nhaha" | grep -v ^$`
#str2=`echo -e "\n" |... (4 Replies)
I have a file hello.txt which was created today (today's date timestamp)
I wish to change its date timestamp (access, modified, created) to 1 week old i.e one week from now.
uname -a
SunOS mymac 5.11 11.2 sun4v sparc sun4v
Can you please suggest a easy way to do that ? (12 Replies)
Discussion started by: mohtashims
12 Replies
LEARN ABOUT OSX
net::ldap::control::passwordpolicy
Net::LDAP::Control::PasswordPolicy(3) User Contributed Perl Documentation Net::LDAP::Control::PasswordPolicy(3)NAME
Net::LDAP::Control::PasswordPolicy - LDAPv3 Password Policy control object
SYNOPSIS
use Net::LDAP;
use Net::LDAP::Control::PasswordPolicy;
use Net::LDAP::Constant qw( LDAP_CONTROL_PASSWORDPOLICY );
$ldap = Net::LDAP->new( "ldap.example.com" );
$pp = Net::LDAP::Control::PasswordPolicy->new;
$mesg = $ldap->bind( "cn=Bob Smith,dc=example,dc=com",
password => "secret",
control => [ $pp ] );
# Get password policy reponse
my($resp) = $mesg->control( LDAP_CONTROL_PASSWORDPOLICY );
if (defined($resp)) {
my $v = $resp->pp_error;
print "Password policy error $v
" if defined $v;
$v = $resp->time_before_expiration;
print "Password expires in $v second(s)
" if defined $v;
}
DESCRIPTION
"Net::LDAP::Control::PasswordPolicy" provides an interface for the creation and manipulation of objects that represent
"PasswordPolicyRequest"s and "PasswordPolicyResponse"s as described by draft-behera-password-policy-09.
This control can be passed to most operations, including the bind.
CONSTRUCTOR ARGUMENTS
There are no constructor arguments other than those provided by Net::LDAP::Control.
METHODS
time_before_expiration
If defined, this is an integer value holding the time left in seconds before the account's password will expire.
grace_authentications_remaining
If defined, this is an integer value holding the number of authentication requests allowed before the account is locked.
pp_error
If defined, this contains a more detailed error code for the account. See Net::LDAP::Constant for definitions of each. Values can
include:
LDAP_PP_PASSWORD_EXPIRED
LDAP_PP_ACCOUNT_LOCKED
LDAP_PP_CHANGE_AFTER_RESET
LDAP_PP_PASSWORD_MOD_NOT_ALLOWED
LDAP_PP_MUST_SUPPLY_OLD_PASSWORD
LDAP_PP_INSUFFICIENT_PASSWORD_QUALITY
LDAP_PP_PASSWORD_TOO_SHORT
LDAP_PP_PASSWORD_TOO_YOUNG
LDAP_PP_PASSWORD_IN_HISTORY
SEE ALSO
Net::LDAP, Net::LDAP::Control, Net::LDAP::Constant, draft-behera-ldap-password-policy-09.txt
AUTHOR
Chris Ridd <chris.ridd@isode.com>
Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>
COPYRIGHT
Copyright (c) 2008 Chris Ridd. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same
terms as Perl itself.
perl v5.16.2 2012-09-20 Net::LDAP::Control::PasswordPolicy(3)