Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to run a series of commands in tmux from a remote file like so:

tmux $(wget -qO- http://example.com/tmux)

The file contains commands like split-window and send-keys

The problem is, send-keys is stripping spaces. The send-keys commands is:

send-keys ssh example.com C-m;

But instead it sends sshexample.com

Any idea why?

Cheers!

share|improve this question
up vote 2 down vote accepted

As a guess, it's interpreting "send-keys ssh example.com C-m;" as four separate arguments and not knowing what to put between them.

Try:

tmux "$(wget -qO- http://example.com/tmux)"
share|improve this answer

I've struggled a bit with similar issue. The solution turned out to be:

tmux send-keys -l $var;
tmux send-keys C-m;

thanks to -l, tmux paid attention to all the signs. On the downside, it didn't accept <enter> so separated call is required.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.