06-25-2004
Check length of Shell Variable
I am using a Korn Shell script..
I need to verify the length of a variable..
ie number=12345
I need then to check 12345 to make sure its no longer than 5 digits...
Can you help?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Discussion started by: r1500
2 Replies
2. UNIX for Dummies Questions & Answers
Hi, all.
I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file:
10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783
19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657
And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies
3. Shell Programming and Scripting
what is the maximum length of a unix shell variable which can be can passed to plsql variable:( (1 Reply)
Discussion started by: alokjyotibal
1 Replies
4. UNIX for Dummies Questions & Answers
hi guys, im learning so be gentle...
i'm wanting to write a script to read in a customer number.
in order that the code is robust i want to check
1) the length of the value entered (4 characters)
2) that all characters entered are numeric between the values 1 to 3
3) that a value is... (1 Reply)
Discussion started by: skinnygav
1 Replies
5. Shell Programming and Scripting
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
(H)eader Records
(D)etail Records
(T)railer Records
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies
6. Shell Programming and Scripting
Hi,
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies
7. Shell Programming and Scripting
hello,
i have a variable which should have following content :
var="value1"
or
var="value2"
or
var="value2:*" # example: value2:22
how can i check :
- if the content is ok (value1 / value2* )
- the two options of "value2"
when content is example "value2:22" , i want to split... (3 Replies)
Discussion started by: bora99
3 Replies
8. Shell Programming and Scripting
Hi,
I have a issue, I need to loop through a comma delimited file and check for the length which exceeds specified length , if Yes truncate the string.
But my problem is , I do not have to check for all the fields and the field lenght is not same for all the fields.
For ex:
Say my line... (9 Replies)
Discussion started by: rashmisb
9 Replies
9. Shell Programming and Scripting
Hi,
I have a No Delimiter variable length text file with following schema -
Column Name Data length
Firstname 5
Lastname 5
age 3
phoneno1 10
phoneno2 10
phoneno3 10
sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 Replies
10. Shell Programming and Scripting
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 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)