Hi guys,
I am not very experienced in writing ksh scripts and I am trying to write a piece of code that indicates if a given string contains only digits and no alphabet (upper or lower case). If i write it my way it would turn out to have a lot of comparisons.. :eek:
Thanks a lot in... (3 Replies)
How could I check if a numeric variable has 5 digits in KSH...I have a zipcode variable that I know will always be 5 digits, and I want to print out an error if it is less or more than 5 digits the problem is that I have it as:
if ]
but this won't work because the statement doesn't see 0001 as... (3 Replies)
Hi all,
i have such string stored in a variable
var1 = 00000120
i want the o/p
var1 = 120
is it possible to have such o/p in ksh/bash ...
thanx in advance for the help
sonu (3 Replies)
Hello,
i have a file called test
hello1
"how" are you4
good"bye"
good7bye
i am trying to print all lines from test that either end with a digit or contain a double quote character anywhere on the line.
i did
grep -n '$' test and was able to print lines ending with digits.
i also did... (2 Replies)
I would like to search between two a string. I thought this would be easy. The is always at the beginning of a line.
The code:
gawk '/^/{d=$1},/searchstring/,/^(d+1)/'
or
gawk '/^/,/searchstring/,/^/'
did not return the desired result.
inputfile.txt
999 some text searchstring some... (6 Replies)
Hi All,
I am trying to find non-printable characters in a string. The sting could have alphanumeric, puntuations and characters like (*&%$#.') but not non-printable (or that is what I think they are called) which are introduced when you copy any text from DOS to unix box.
Input string1:... (10 Replies)
Hello,
I have a log file with logs such as
01/05/2017 10:23:41 : file.log.38: database error, MODE=SINGLE, LEVEL=critical, STATE: 01170255 (mode main
how can i use perl to extract the 8-digit number below from the string
01170255
Thanks (7 Replies)
I am using the below to random generate a password but I need to have 2 numeric characters and 6 alphabetic chars
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo ''
6USUvqRB
------ Post updated at 04:43 PM ------
Any Help folks - Can the output be passed onto a sed command to... (9 Replies)
Discussion started by: infernalhell
9 Replies
LEARN ABOUT CENTOS
pwquality.conf
PWQUALITY.CONF(5) File Formats Manual PWQUALITY.CONF(5)NAME
pwquality.conf - configuration for the libpwquality library
SYNOPSIS
/etc/security/pwquality.conf
DESCRIPTION
pwquality.conf provides a way to configure the default password quality requirements for the system passwords. This file is read by the
libpwquality library and utilities that use this library for checking and generating passwords.
The file has a very simple name = value format with possible comments starting with # character. The whitespace at the beginning of line,
end of line, and around the = sign is ignored.
OPTIONS
The possible options in the file are:
difok
Number of characters in the new password that must not be present in the old password. (default 5)
minlen
Minimum acceptable size for the new password (plus one if credits are not disabled which is the default). (See pam_pwquality(8).)
Cannot be set to lower value than 6. (default 9)
dcredit
The maximum credit for having digits in the new password. If less than 0 it is the minimum number of digits in the new password.
(default 1)
ucredit
The maximum credit for having uppercase characters in the new password. If less than 0 it is the minimum number of uppercase char-
acters in the new password. (default 1)
lcredit
The maximum credit for having lowercase characters in the new password. If less than 0 it is the minimum number of lowercase char-
acters in the new password. (default 1)
ocredit
The maximum credit for having other characters in the new password. If less than 0 it is the minimum number of other characters in
the new password. (default 1)
minclass
The minimum number of required classes of characters for the new password (digits, uppercase, lowercase, others). (default 0)
maxrepeat
The maximum number of allowed same consecutive characters in the new password. The check is disabled if the value is 0. (default
0)
maxsequence
The maximum length of monotonic character sequences in the new password. Examples of such sequence are '12345' or 'fedcb'. Note
that most such passwords will not pass the simplicity check unless the sequence is only a minor part of the password. The check is
disabled if the value is 0. (default 0)
maxclassrepeat
The maximum number of allowed consecutive characters of the same class in the new password. The check is disabled if the value is
0. (default 0)
gecoscheck
If nonzero, check whether the words longer than 3 characters from the GECOS field of the user's passwd entry are contained in the
new password. The check is disabled if the value is 0. (default 0)
badwords
Space separated list of words that must not be contained in the password. These are additional words to the cracklib dictionary
check. This setting can be also used by applications to emulate the gecos check for user accounts that are not created yet.
dictpath
Path to the cracklib dictionaries. Default is to use the cracklib default.
SEE ALSO pwscore(1), pwmake(1), pam_pwquality(8)AUTHORS
Tomas Mraz <tmraz@redhat.com>
Red Hat, Inc. 10 Nov 2011 PWQUALITY.CONF(5)