随笔 - 746  文章 - 0  评论 - 39  阅读 - 79万

busybox:ash:PS1:支持的内部替换变量

网上资料没查到,那就找源码呗!

xxx\libbb\lineedit.c

复制代码
/*
 * Supported via bb_process_escape_sequence:
 * \a    ASCII bell character (07)
 * \e    ASCII escape character (033)
 * \n    newline
 * \r    carriage return
 * \\    backslash
 * \nnn    char with octal code nnn
* Supported: * \$ if the effective UID is 0, a #, otherwise a $ * \w current working directory, with $HOME abbreviated with a tilde * Note: we do not support $PROMPT_DIRTRIM=n feature * \W basename of the current working directory, with $HOME abbreviated with a tilde * \h hostname up to the first '.' * \H hostname * \u username * \[ begin a sequence of non-printing characters * \] end a sequence of non-printing characters * \T current time in 12-hour HH:MM:SS format * \@ current time in 12-hour am/pm format * \A current time in 24-hour HH:MM format * \t current time in 24-hour HH:MM:SS format * (all of the above work as \A) * Not supported: * \! history number of this command * \# command number of this command * \j number of jobs currently managed by the shell * \l basename of the shell's terminal device name * \s name of the shell, the basename of $0 (the portion following the final slash) * \V release of bash, version + patch level (e.g., 2.00.0) * \d date in "Weekday Month Date" format (e.g., "Tue May 26") * \D{format} * format is passed to strftime(3). * An empty format results in a locale-specific time representation. * The braces are required. * Mishandled by bb_process_escape_sequence: * \v version of bash (e.g., 2.00)
*/
复制代码

 

posted on   jinzhenshui  阅读(121)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2009-06-09 Mysql:命令选项、配置选项、(全局、会话)系统变量、状态变量:各种应用程序及选项
2009-06-09 Mysql:事务管理——未完待续

点击右上角即可分享
微信分享提示