emulate sh

PostgreSQL的configure 脚本中有如下代码:

if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in  *posix*) set -o posix ;;
  esac

fi

之前已经验证过,如果系统当前shell为 zsh, 则执行 emulate sh 命令。

那么 emulate sh 到底是干什么的呢?可以参见下列的解释:

http://www.acm.uiuc.edu/workshops/zsh/emulation.html

Zsh can emulate sh, ksh, or csh. (csh is not fully emulated). zsh does an outstanding job in its sh and ksh emulation.

You can start emulating another shell by running emulate some_shell from the command line. If you add the -R flag, all options will be reset to their default values.

You can also create a link called 'csh', or 'ksh', or 'sh' that points to zsh. Zsh will notice that it was invoked with a different name, and do its best to behave like the shell you specify.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值