在 Unix 中执行 KornShell (ksh) 脚本是否需要权限设置?
我很想知道为什么我无法运行特定的 *.ksh 文件。是不是权限设置的原因?如果是的话,我该如何解决这个问题?我没有以管理员身份登录,是否需要成为管理员才能运行 *.ksh 文件?
I am interested to know why is it that I can't run a specific *.ksh file. Is it due to permission settings? If it is, how can I work around that? I'm not logging on as the administrator, do I need to be an administrator to run *.ksh files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,您不需要成为管理员,但您确实需要拥有权限。
如果您想使用以下命令运行它:
它将需要您具有执行权限。如果你已经阅读但没有执行,你可以这样做:
如果你连这个都没有,那你就运气不好了。
运行命令:(
替换实际脚本名称)以查看权限。它们类似于:
这意味着所有者(bob)可以读取、写入和执行,组(pleb)可以读取和执行,而其他人只能读取。
No, you don't need to be administrator but you do need to have permissions.
If you want to run it with something like:
it will need to have execute privileges for you. If you have read but no execute, you can do:
If you don't even have that, you're fresh out of luck.
Run the command:
(substituting the actual script name) to see the permissions. They'll be something like:
which means read, write and execute for the owner (bob), read and execute for the group (plebs) and read only for everyone else.
尝试使用以下 chmod Unix shell 命令来使 KornShell (ksh) 脚本可执行:
“755 表示每个人都具有读取和执行权限,并且还表示文件所有者具有写入权限。执行 chmod 755 filename 命令时,您允许每个人读取和执行文件的所有者也可以写入该文件。” chmod-755
Try this chmod Unix shell command to make the KornShell (ksh) script executable:
"755 means read and execute access for everyone and also write access for the owner of the file. When you perform chmod 755 filename command you allow everyone to read and execute the file, owner is allowed to write to the file as well." chmod-755