1

I tried to rsh a shell script from OpenVms to a Red Hat linux. It seems that it is not executed.

I created the shell script in OpenVms and Ftp it to the linux. I then ls -la the folder in linux:

-rw-r--r--    1 buedev   buedev        382 Jul 20 11:03 files.sh

It seems that even the owner don't have the right to execute. And if we need to chmod it, how can we do it remotely in OpenVms?

Caleb
  • 69,278
  • 18
  • 196
  • 226
lamwaiman1988
  • 1,996
  • 6
  • 23
  • 32

1 Answers1

2

In order to execute, the execute bit must be set. Even the owner of a file cannot ask the system to execute it if it's not marked as executable.

The one caveat here is that in the case of most shell scripts, you can execute them by calling the shell yourself and feeding the script data to it as an argument.

/bin/sh /path/to/files.sh

This would execute the sh shell and send it the text data for your script to be executed. This only requires read-permission on the file because the shell is what is being executed and it only needs to read the script not execute it.

You can change the permissions of files that will be written by setting the umask in your ftp preferences, or use a shell later to chmod them. Some ftp daemons also support changing the permissions on existing files.

Caleb
  • 69,278
  • 18
  • 196
  • 226