Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ksh没有该命令,我无法执行我的 KornShell (ksh) 脚本。我包含#!/bin/ksh在脚本的第一行,但是当我尝试仅按名称执行它时,它说没有这样的文件或目录。有人能帮我吗?
ksh
#!/bin/ksh
确保ksh正确安装在/bin/ksh
/bin/ksh
which ksh从命令行尝试。
which ksh
考虑#! /usr/bin/env ksh更多的便携性。
#! /usr/bin/env ksh
用于从存在的目录中script的命令行执行运行。./scriptscript
script
./script
如果script要从任何不带./前缀的目录执行,则必须将路径添加script到PATH环境变量中,添加此行
./
PATH
export PATH="path_to_your_script":$PATH
给你的 ~/.kshrc文件。
~/.kshrc