LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-11-2004, 05:40 AM   #1
luxpops
LQ Newbie
 
Registered: Sep 2004
Location: new zealand
Distribution: red hat fedora
Posts: 9

Rep: Reputation: 0
Question how do u check if password has enough characters??


Hi
when creating users and password
I would like to know what would be the command to check if the lenght of the password entered has the min and max character required.
like 5 to 8 characters
 
Old 09-11-2004, 05:45 AM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 243Reputation: 243Reputation: 243
a suggestion :

echo $password | wc -c
 
Old 09-11-2004, 07:42 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,724

Rep: Reputation: 434Reputation: 434Reputation: 434Reputation: 434Reputation: 434
and a small enhancement:

echo "$password" | wc -c

as a password can contain special characters that could mess both echo and the shell.
 
Old 09-11-2004, 09:39 PM   #4
luxpops
LQ Newbie
 
Registered: Sep 2004
Location: new zealand
Distribution: red hat fedora
Posts: 9

Original Poster
Rep: Reputation: 0
how would u implement that in gawk??
 
Old 09-12-2004, 05:30 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,724

Rep: Reputation: 434Reputation: 434Reputation: 434Reputation: 434Reputation: 434
length(password)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to check root password reset log cmsisb Red Hat 1 04-11-2005 08:23 AM
Command Line Password Check jedediah Linux - Security 4 12-09-2004 04:01 PM
making the minimum password lenght to less than 5 characters da_kidd_er Linux - Security 1 09-28-2004 07:24 AM
encrypted password 64 characters? uribo Programming 1 04-22-2003 08:51 AM
Having Password Speciall Characters on the screen JStew Programming 4 02-11-2003 01:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration