1

I want a run a script located on server 2 from server 1.

I am running this command line on server 1:

/home/user_x/keys.pem -t -t [email protected] sudo /home/gather/scripts/startTomcat6_nonroot.sh

Which give me this error:

/home/user_y/tomcat/bin/startup.sh: line 11: uname: command not found

Here is the snippet of this file on server 2 containing the uname command:

#!/bin/sh os400=false darwin=false #line bellow is number 11, the one failing case "`uname`" in CYGWIN*) cygwin=true;; OS400*) os400=true;; Darwin*) darwin=true;; esac 

1 Answer 1

2

The most likely cause for this is a $PATH on server 2 that doesn't include uname; sanity check the environment variables when logged in under that user.

6
  • yes I think is the issue, do you know how to solve it? Commented Dec 12, 2014 at 21:59
  • @JeromeAnsia It depends completely on the system - you'll need to review the files that are manipulating $PATH to find whatever's breaking it and fix it. Examining what's in it will probably offer a clue. Commented Dec 12, 2014 at 22:00
  • K thank you Shane, a weird think also if I do "ssh -i /home/userx/keys.pem -t -t [email protected] 'uname'", it's working without trouble (got Linux) Commented Dec 12, 2014 at 22:03
  • @JeromeAnsia How about if you do sudo uname instead of just uname? Commented Dec 12, 2014 at 22:08
  • 1
    @JeromeAnsia Actually, I've changed my mind - instead of trying to track down what's fiddling with $PATH, which might well be a needle in a haystack depending how much of a unique snowflake that server is, just change uname in your script to /bin/uname, so $PATH doesn't need to be accurate. Commented Dec 12, 2014 at 22:15

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.