I want to setup a time prompt on PS1. But, there is no document about what are symbols the busybox support.
Is there any one know? Here are all which I knew.
PS1='\u@\h: \w \$'
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
BusyBox has two shells, ash and hush. To see which one you have, run
type chdir: ash has it as a builtin (synonymous with
cd), hush doesn't. Both have an optional prompt expansion feature. Ash's is enabled by activating the
ASH_EXPAND_PRMT feature at compile time, while hush requires
When that feature is present, in ash the value of
PS1 is expanded like a double-quoted string:
`command` constructs are expanded.
Some backslash escapes are processed (in ash, after substitutions). They are a subset of bash's.
\!: line history count
\f: form feed
\h: host name
\r: carriage return
\u: user name (only with
\v: vertical tab
\w: current directory, with
~for the home directory (only with
\W: current directory (unabbreviated)
\XHHwhere HH are two hexadecimal digits: a character given by its hex code
\[…\]: the enclosed text doesn't count for width calculation purposes
(If you're looking at the source code, this happens in