1

I have a KornShell (ksh) script in Server A that will run a script in ServerB.

    #!/bin/ksh/
    ssh user@server "/path/script.sh"

The script permissions are as follow:

 -rwxrwxrwx   1 user    dba           75 Jun 11 10:00 script.sh

I checked the existence of 'ksh' in /bin and its there. (bash is not)

When I try to run the script I get ./script.sh: cannot execute

What could be happening? I tested the ssh command manually and it works.

Its a SunOS system.

javaPlease42
  • 4,699
  • 7
  • 36
  • 65
Rhyuk
  • 163
  • 2
  • 17

1 Answers1

6

Delete the trailing / in #!/bin/ksh/.. leaving it there causes an error for me too.

This is the message I get with the trailing slash under Linux (more descriptive than SunOS it appears):

ksh: ./so2.sh: cannot execute [Not a directory]
Levon
  • 138,105
  • 33
  • 200
  • 191