LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-25-2010, 02:25 PM   #1
raceman
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 0
apg password without non-alphanumeric characters


I'm trying to get a password in a bash script for mysql user creation. But sometimes a get a non-alphanumeric character(s) in the password, and mysql failes with that.

I tryed with apg -EO0Il1`~!@#$%^&*()_+-=[]\;./{}|:"'<>? but failed.

I tryed with sed 's/[^a-zA-Z2-9]//g' , but at that moment the minimum password lenght failed.

I'm also fine when there is a better alternative then apg.
Thank you for helping.
 
Old 04-26-2010, 12:27 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Hi, welcome to LQ!

I didn't bother trying to understand your apg invocation, but:

why don't you just use
Code:
apg -MCLN -m 8
or replace 8 w/ however long you need your passwords.




Cheers,
Tink
 
1 members found this post helpful.
Old 04-26-2010, 05:41 AM   #3
raceman
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks Tinkster. I got this answer via Aardvark to, and it helps!
 
  


Reply

Tags
bash, password


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
APG (Automatic Password Generator) very slow to answer jmcollin92 Linux - Security 2 05-23-2006 02:23 PM
how do u check if password has enough characters?? luxpops Programming 4 09-12-2004 05:30 AM
encrypted password 64 characters? uribo Programming 1 04-22-2003 08:51 AM
Is a Radeon 7500 apg x4 card easier to install than nvidia? pdmackenzie Linux - Hardware 7 03-26-2003 08:17 AM
Having Password Speciall Characters on the screen JStew Programming 4 02-11-2003 01:27 PM


All times are GMT -5. The time now is 11:06 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration