Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
tttty
V2EX  ›  Linux

为什么 zsh 数组下标是从 1 开始的

  •  
  •   tttty · May 4, 2017 · 3990 views
    This topic created in 3365 days ago, the information mentioned may be changed or developed.

    之前用过一段时间 fish,配置无脑简单,但是跟 bash 过于不兼容于是转了群众都推荐的 zsh。
    虽然平时用起来挺爽的,但是最近写 shell 脚本才发现如题所述的问题。
    既然 bash 数组下标是从 0 开始的,为什么其他 shell 还要标新立异呢?
    有什么历史遗留的典故吗..

    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1157 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 23:10 · PVG 07:10 · LAX 16:10 · JFK 19:10
    ♥ Do have faith in what you're doing.