Friday, 23 August 2013

debian bash/sh string execution

debian bash/sh string execution

I am stuck with this piece of code here
user@server:~$ TEST="ssh rsync@example.org 'date; date; date'"
user@server:~$ $TEST
bash: date; date; date: Command not found.
I want to use this inside a shell script an don't know what s the problem.
Both systems are debian wheezy,
but if execute the command directly:
user@server:~$ ssh rsync@example.org 'date; date; date'
Fre Aug 23 16:10:05 CEST 2013
Fre Aug 23 16:10:05 CEST 2013
Fre Aug 23 16:10:05 CEST 2013
So whats the big deal here???? I realy am missing out something very
trivial, but just cant figure it out... Please help...
The idea behind this, is that i build up a long string inside a script and
execute it remotely in a single SSH session (renaming of zfs snapshots all
in a row n.0 becomes n.1 and so on)
But its not working a is want it to work...

No comments:

Post a Comment