The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl - SQLite question garric Shell Programming and Scripting 4 04-09-2008 05:51 AM
sqlite database in HP-UX vs Linux perlprg HP-UX 1 05-08-2007 11:56 PM
sqlite issue? brandan UNIX for Dummies Questions & Answers 0 07-23-2004 07:44 PM
rpm hell! knmwt15000 UNIX for Dummies Questions & Answers 7 03-27-2002 02:06 AM
negative UID/GID?!! I can see 'em but what the hell do they mean?! hellz UNIX for Dummies Questions & Answers 2 09-07-2001 12:18 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-20-2008
Registered User
 

Join Date: May 2008
Posts: 5
Stumble this Post!
hell and sqlite

Hi everyone,

I have a requirement that requires me to fill an sqlite database with 100,000 entries (no duplicates).

I will start out by giving the command that will insert the values necessary to populate the database:

# sqlite /var/local/database/dblist "insert into list (owner_id,behavior,entry)

values(0,0,'newblacklistentry.com') "

The challenge would be to get a different output for the entry value 100,000 times!

We can start with newurl.com and maybe append a numerical character to the string e.g.

newurl1.com
newurl2.com
newurl3.com

* I'm running on Linux

Your thoughts?

Thanks for looking

Carlo
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-20-2008
Registered User
 

Join Date: May 2008
Posts: 39
Stumble this Post!
try this:

Code:
#!/bin/sh
i=1
while [ $i -le 50 ]
do

sqlite /var/local/database/dblist "insert into list (owner_id,behavior,entry) values(0,0,'newblacklistentry$i.com') "

  i=`expr $i + 1`
done
if it works turn the value "50" to "100000" and let it roll
Reply With Quote
  #3 (permalink)  
Old 05-20-2008
Registered User
 

Join Date: May 2008
Posts: 5
Stumble this Post!
Awesome! Works

Thanks scarfake That's how we roll!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0