zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Potter <jpotter-zookee...@codepuppy.com>
Subject Re: Passing multiple commands to zkCli on the commandline
Date Fri, 09 Jan 2015 21:10:51 GMT

Try:
	printf "create /test3 'sth'  \n create /test3 'sth' " | zkCli
?

This:
	echo "create /test3 'sth'  \n create /test3 'sth’ "
doesn’t actually generate a newline.

# echo "create /test3 'sth'  \n create /test3 'sth' " 
create /test3 'sth'  \n create /test3 'sth’  

-Jeff


> On Jan 9, 2015, at 2:44 AM, Peter Schrammel <peter.schrammel@preisanalytics.de>
wrote:
> 
> Hi,
> 
> is there a way to pass multiple commands to zkCli on the command line?
> 
> this works:
> echo "create /test3 'sth' " | zkCli
> 
> but this doesn't
> echo "create /test3 'sth'  \n create /test3 'sth' " | zkCli
> 
> what I'd like to do is to authenticate and then create nodes (chef setup of a server)
so splitting the multiple zkCli commands into multiple bash commands doesn't work.
> 
> THX
> Peter

Mime
View raw message