Bug 10901

Summary: Shell parameter expansion not working for /
Product: Busybox Reporter: camabeh
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.27.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description camabeh 2018-03-29 11:14:21 UTC
Hello, I am trying to escape varaible which will be used in `sed` command but unfortunately it looks like there is some bug in handling parameter expansion in busybox shell.

Expected:
> Bash in Ubuntu:
```sh
$ var="/Users/Documents/name/file"; echo "${var//\//\\/}"
\/Users\/Documents\/name\/file
```

Actual:
> Shell in Alpine:
```sh
$ var="/Users/Documents/name/file"; echo "${var//\//\\/}"
/Users/Documents/name/file
```

It's wierd because parameter expansion with replacement is working for other characters.

> Bash in Ubuntu:
```sh
$ var="/Users/Documents/name/file"; echo "${var//e/E}"
/UsErs/DocumEnts/namE/filE
```
> Shell in Alpine:
```sh
$ var="/Users/Documents/name/file"; echo "${var//e/E}"
/UsErs/DocumEnts/namE/filE
```

Env:
BusyBox v1.27.2 (2017-11-28 16:17:30 GMT) multi-call binary.
Alpine 3.7

Ref:
https://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion
Comment 1 Denys Vlasenko 2018-04-08 14:57:44 UTC
Fixed in git, will be in 1.29.x