yudai / sshh

A SSH session duplicator for tmux
Apache License 2.0
80 stars 10 forks source link

Unary operator expected error #1

Closed gaynetdinov closed 9 years ago

gaynetdinov commented 9 years ago

Hey! I've got the following error:

 sshh ${SSHH_INDEX}
damir.gaynetdinov:~/ $  sshh ${SSHH_INDEX}                                                                  [9:49:41]
cat: /proc/47196/cmdline: No such file or directory
/usr/local/bin/sshh: line 41: [: =: unary operator expected
Command at Pane #0 of Window #5 is not SSH.
-n Do you want to run '' ? [y/N]:
y
No running command at Pane #0 of Window #5

Step-by-step

  1. wget https://raw.githubusercontent.com/yudai/sshh/master/sshh
  2. sudo mv sshh /usr/local/bin/
  3. sudo chmod +x sshh /usr/local/bin/sshh (actually I'd love to have this line as a step of installation process)
  4. add bindings to tmux config, reload tmux
  5. ssh foo@bar
  6. C-a C-s
  7. Got an error as above

OS X Yosemite 10.10.3

$ zsh --version                                                                        
zsh 5.0.7 (x86_64-apple-darwin14.0.0)

Am I doing something wrong? Thanks!

yudai commented 9 years ago

Thank you for the report. I had not tested this command on OS X at all. I fixed the problem and it should work now on OS X as well.

The cause of the issue you got was that the script had used the /proc directory to get the command running in the pane you specified. This directory is available only Linux systems, so I replaced the method to retrieve commands with the ps command which is available both of Linux and OS X.

Thanks!

yudai commented 9 years ago

And I added a note about the execution permission to README as well. Thank you for the feedback.