FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » More Linux help needed

   
Author Topic: More Linux help needed
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
So I need to write a script via emacs or overwise that will form a unique user id and password for someone.

It will take the first 3 letters of both the 1st and last name and merge them together to form a unique user id and if that combination already exist appends a # to it.

Also it will with the RedHat Linux dictionary give each word a number and randomly generate a number which correponds to each word, from there it will take 2 random words and put them together to form a unique password.

How would I go about working on it?

IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
I'm not sure why you need to associate numbers with words from the dictionary instead of just picking two at random straight off, but whatever.

I'm not sure what you see as the issue; the specification seems very straightforward. Which step troubles you?

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
figuring out what I'm supposed to do in Linux as in writing the actual code, I'm going brain dead for absolutely no reason.
IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
I'm assuming you're supposed to do this in shell scripting?

Well, what shell commands have you learned for manipulating strings? What shell commands are there for the dictionary?

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
ummm the whole manual.

currently I'm getting cut to work, how ould I only cut the first 3 letters of oth the the given and surnames?

IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
You're going to need to figure out how you're going to interact with the user. You have likely been taught this.

As for how to cut where, I suggest reading man cut. Look at the -c option. Try some things.

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
I had already about 2 minutes ago figured that by doing:

y="Blayne Bradley"
echo $y

[cs326_2 etc$] Blayne Bradley
[cs326_2 etc$] echo $y | cut -d',' -f1 | cut -c1-3 | cut -d',' -f2 | cut -c2-4
[cs326_2 etc$] BlaBra

that sorta works I did it one at a time command lines and some work maybe needed first to make it usable all in one line.

IP: Logged | Report this post to a Moderator
   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2