gpt4 book ai didi

command-line - zsh:未找到 strftime 命令

转载 作者:行者123 更新时间:2023-12-04 04:46:03 25 4
gpt4 key购买 nike

我目前正在学习 zsh,现在我想使用 strftime但我得到:

zsh: command not found: strftime



我认为我做错了什么,因为我看到人们一直在他们的 dotfiles 中使用该功能。

最佳答案

strftimezsh 中定义名为 datetime 的模块. zmodload命令从 $module_path 中以冒号分隔的目录列表加载模块.

在我的系统上:

% echo $module_path
/usr/lib/zsh/4.3.10
% ls -l $module_path
drwxr-xr-x 3 root root 4096 2009-11-05 01:03 zsh
% ls -l $module_path/zsh/datetime*
-rw-r--r-- 1 root root 9828 2009-09-10 02:45 /usr/lib/zsh/4.3.10/zsh/datetime.so
% type -a strftime
strftime not found
% zmodload zsh/datetime
% strftime %Y-%m-%d 1271603087
2010-04-18
% type -a strftime
strftime is a shell builtin
% /bin/date -d @1271603087 +%Y-%m-%d
2010-04-18

关于command-line - zsh:未找到 strftime 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2662127/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com