Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.