On 2013-03-29 01:36:06 -0700, Oleksandr Drach wrote: > Hi Dormando! > I try both BASH and PHP but result is the same. Here is my code: > > Bash: > > #!/bin/bash > memc_src=«127.0.0.1 11211» > memc_keys_values_file="/tmp/memcached.keys-values" > IFS=" " > while read key value > do > val_len=$(expr length $value) > echo -e «add $key 0 2592000 $val_len\r\n$value\r» | nc $memc_src >> /dev/null > done < "$memc_keys_values_file"
That script has two issues:
1. It uses «» quotes instead "" quotes in some places. I assume that they
were replaced by your mailer.
2. nc (at least the version I have) blocks waiting for memcached to
close the connection. I had to insert a quit command.
After those changes the script successfully inserted 3000 items.
hp
--
_ | Peter J. Holzer | Der eigene Verstand bleibt gefühlt messer-
|_|_) | Sysadmin WSR | scharf. Aber die restliche Welt blickt's
| | | [email protected] | immer weniger.
__/ | http://www.hjp.at/ | -- Matthias Kohrs in desd
signature.asc
Description: Digital signature
