drupal - difference btwn entering commands after ssh vs entering as a one-liner -
kind of odd problem: when this, works fine:
ssh abc@myurl drush -v but fails:
ssh abc@myurl "drush -v" it produces:
: no such file or directorysh/drush: line 10: cd: /cygdrive/c/programdata/drush /drush.phpopen input file: . exact same commands, doesn't work inline command, need in order script thing. yes, cygwin involved, dunno if that's relevant here, not.
any idea how make 2nd form work? other commands work fine, eg:
ssh abc@myurl "cd /cygdrive/c/mydrupaldir; pwd" [edit] i've narrowed down steps reproduce simplicity, , found reason fails: drush has special handling cygwin, relies on uname -a determine, , key difference:
ssh abc@myurl uname -a produces:
cygwin_nt-6.1 myurl 1.7.28(0.271/5/3) 2014-02-09 21:06 x86_64 cygwin but this:
ssh abc@myurl "uname -a" produces:
server 4.0 windows32 myurl 2.6.1 7601 ix86-pc amd unknown mingw i've solved immediate problem hard-coding changes script, question is, why uname give different results in these 2 scenarios?
because you're trying execute shell command without environment variables. system doesn't know how answer. correct way is:
ssh abc@myurl "/usr/bin/bash.exe -cl 'uname -a'" here -c reading following string commands, while -l used specify bash should invoked "login shell". there other working variations on this.
Comments
Post a Comment