Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

interactive script help

Status
Not open for further replies.

marcmcconnell

Technical User
Apr 19, 2001
25
GB
I have an interactive script - a binary called hdbmap. I would like to know how to run it for a large list of numbers - (using the "del" option for this script - to delete numbers from a database)

Example output:

I type :
hdbmap <enter>

f /usr/bin/conf/blabla <enter> (path of config file)

I then have to type:
del "number" <enter>

I have a list of about 90000 numbers I want to delete from the database. I have tried some forloops without success. Any ideas?
 
Something like?:

while read num
do
hdbmap <<EOF
f /usr/bin/conf/blabla
del $num
EOF
done < list_of_numbers.txt


Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
Thanks for the help - I tried what you suggested - however, the hdbmap scripts seems to go into a loop when I try this (ie hdbmap is displayed continuosly - as if it is looking for an argument.

Any ideas?
 
Is there a log file for hdbmap, Marc? I should have specified that the final EOF needs to be on it's own line, with no white space (or tabs) before it. This probably isn't the problem, but you never know.

Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
Does this part work on its own?

[tt]num=1234
hdbmap <<EOF
f /usr/bin/conf/blabla
del $num
EOF[/tt]

Maybe the hdbmap programme doesn't read input from stdin.


Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top