[BusyBox 0000647]: ash does not handle '\$' in prompt when prompt expansion is enabled

bugs at busybox.net bugs at busybox.net
Fri Dec 22 13:08:30 UTC 2006


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=647 
====================================================================== 
Reported By:                iggarpe
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   647
Category:                   Documentation
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             01-18-2006 00:44 PST
Last Modified:              12-22-2006 05:08 PST
====================================================================== 
Summary:                    ash does not handle '\$' in prompt when prompt
expansion is enabled
Description: 
If you use ash, and CONFIG_ASH_EXPAND_PRMT is enabled, you'll see '$' in
the prompt even if you are root.

I've traced the bug and it seems that prompt expansion turns the default
value of PS1='\w \$ ' into PS1='\w $ ', that is, just removes the '\' in
front of the '$', thus from there on, '$' is printed as a literal in the
prompt. I guess prompt expansion is broken somehow.
====================================================================== 

---------------------------------------------------------------------- 
 vodz - 01-18-06 01:03  
---------------------------------------------------------------------- 
I think, its not bug.
Expanding promt works as eval string.
Example:

1$ bash --version
GNU bash, version 2.05b.0(1)-release (i486-slackware-linux-gnu)
Copyright (C) 2002 Free Software Foundation, Inc.
2$ echo `echo '\w'`
\w
3$ echo `echo '\$'`
$ 
4$ echo `echo '\\$'`
\$

\w is invalid escaping, but \$ - valid. First backslash escaping a dollar
char
and evalute without backslash.

If you using EXPAND_PROMPT feature, then must use double escaping shell
special chars for give with backslash to the fancy promt decoder.

Please close this bug. 

---------------------------------------------------------------------- 
 bernhardf - 12-22-06 05:08  
---------------------------------------------------------------------- 
Not a bug. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-18-06 00:44  iggarpe        New Issue                                    
01-18-06 00:44  iggarpe        Status                   new => assigned     
01-18-06 00:44  iggarpe        Assigned To               => BusyBox         
01-18-06 00:47  iggarpe        Issue Monitored: iggarpe                     
01-18-06 00:47  iggarpe        Issue End Monitor: iggarpe                    
01-18-06 01:03  vodz           Note Added: 0000945                          
04-10-06 00:29  iggarpe        Issue Monitored: iggarpe                     
04-10-06 00:29  iggarpe        Issue End Monitor: iggarpe                    
12-22-06 05:08  bernhardf      Status                   assigned => closed  
12-22-06 05:08  bernhardf      Note Added: 0001921                          
======================================================================




More information about the busybox-cvs mailing list