From Bash's manual (Controlling the Prompt]1):
\j the number of jobs currently managed by the shell. \$ If the effective uid is 0, #, otherwise $. What I'd like is to set PS1 to
[some-string] $ when there are no jobs; and
[some-string]2 $ when there are 2 jobs.
How I could I achieve that?
If possible, the solution could be simple, with only basic Bash expansions and possibly Bash builtins.