linux - 如何在不同的 shellscsh/tcsh shell 上执行 sh shell 脚本?

标签 linux shell posix csh tcsh

如何在 csh/tcsh shell 等不同的 shell 上执行 sh shell 脚本? sh 和 csh 或 tcsh 会有不同的语法。?例如:某些 shell 的变量赋值是不同的,例如 sh shell 中的 var=value 和 tcsh 中的 set var=value 类似地 case end stmt esac in sh 和 endsw in tcsh shell。

最佳答案

你的系统应该有/bin/sh,所以你可以像这样运行你的 shell 脚本:/bin/sh YourScript.sh 注意你必须确保你的脚本没有使用任何 csh/tcsh/bash/zsh 特定功能。

关于linux - 如何在不同的 shellscsh/tcsh shell 上执行 sh shell 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40585077/

相关文章:

linux - cygwin编译数学库

linux - 同时运行一个 jar 的多个实例 : memory issue

linux - chroot 环境中的 Telnet

c - 信号和库

c - 将sizeof()的结果分配给ssize_t

c - 当我强制退出服务器(输入 clt + c)时,有什么办法可以做到这一点,客户端也会同时终止吗?

linux - 使用 Apache 版本 2xy 进行转发、屏蔽和别名

linux - ssh sudo 管道命令

linux - 提取没有同名目录的文件

bash - 登录SSH后执行一条语句