LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-23-2011, 07:13 AM   #1
vanid
LQ Newbie
 
Registered: Mar 2011
Posts: 11

Rep: Reputation: 0
randomize character substitution


Hi,

If any one help in my issue:
I done with executing few commands through telnet session automatically..and my code is executing command one by one without user intervention and shows the execution result.

now here what i need is to randomize the commands i.e if i type interactively wrong command then it shows particular error message(execution result here what i above mean it for). but when making automated the script now i want this to be automated i.e i want randomizing the commands execution automated.
SOMETHING OUTPUT LIKE:
$config/all...actual cmd
$config/all....not valid
Config?all....not valid
CONFIG?ALL..not valid
$config\all..not valid

I could really appreciate if any one can help on this...and many thanks in advance
 
Old 03-24-2011, 11:34 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
What exactly do you mean by 'randomising'? What you're doing doesn't seem to be particularly random... Could you break down what you want your program to do? Also, what you're trying to do sounds rather strange. Perhaps a better question would be WHY do you want to do this? What are you trying to achieve? Because it sounds like there may be better ways of doing it, whatever it is...
 
Old 03-24-2011, 11:18 PM   #3
vanid
LQ Newbie
 
Registered: Mar 2011
Posts: 11

Original Poster
Rep: Reputation: 0
I am sorry if my question is little confusing, actually i am new to this scripting language.

As simple as I want to say is: I want any command to be tested with all test cases....so that i can verify the command for all valid and invalid cases likewise we have emailid validation test.
 
Old 03-27-2011, 03:37 PM   #4
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
I'm afraid I'm still finding it difficult to work what exactly you mean by "test cases"... Are you trying to see what happens if a user types a command incorrectly?
 
Old 03-27-2011, 11:13 PM   #5
vanid
LQ Newbie
 
Registered: Mar 2011
Posts: 11

Original Poster
Rep: Reputation: 0
yes exactly that i need it. I want to to see what happens if a user types a command incorrectly? using expect script
 
Old 03-29-2011, 11:38 AM   #6
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Okay, that kinda makes sense now, why do you want to write a script for that? If there are no commands with the mis-spelled name, it will say
Code:
bash: foo: command not found
or something similar. If it happens to be the name of another command, it will run that command...
 
  


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
In Postfix mailserver how we can randomize transports using regexp (using $n ). haridas.nss Linux - Server 2 06-08-2010 01:59 PM
Is it possible to ask DHCP assign a randomize hostname to client? Reaperhk Linux - Server 1 11-20-2009 08:53 PM
randomize non repeated numbers mystical dervish Programming 10 06-15-2007 04:34 AM
Randomize /etc/motd? lengau Linux - General 4 09-05-2005 11:01 PM
How to randomize Splash Image using Gnome??? thinhla Linux - General 1 07-15-2005 10:39 AM

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

All times are GMT -5. The time now is 09:18 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
Open Source Consulting | Domain Registration