小编Lui*_*ire的帖子

如何知道 POSIX shell 脚本上运行的函数名称

我试图弄清楚是否有一种标准方法(不是有效的 hack)来了解当前在 POSIX shell 脚本上执行的函数的名称。我知道我可以用 . 返回脚本的名称$0。如何应用类似函数的东西?

posix sh

5
推荐指数
1
解决办法
980
查看次数

如何在POSIX shell脚本中迭代字符串的字符?

符合POSIX的shell应提供这样的机制来迭代字符串集合:

for x in $(seq 1 5); do
    echo $x
done
Run Code Online (Sandbox Code Playgroud)

但是,如何迭代单词的每个字符?

shell posix sh dash-shell

4
推荐指数
1
解决办法
443
查看次数

标签 统计

posix ×2

sh ×2

dash-shell ×1

shell ×1