"brian m. carlson" <sandals@xxxxxxxxxxxxxxxxxxxx> writes: > Ah, yes, this is true. The statement about "\r" is also true for Linux > with POSIXLY_CORRECT, IIRC. It's nice to have a way to reproduce without having a separate toolchain. Thanks for the suggestion. > Unfortunately, printf is not specified by POSIX to take hex escapes, so > this, too is nonportable. We are unfortunately allowed to use only > octal escapes (yuck). However, we can write this: > > cr=$(printf '\r') > > or > > cr=$(printf '\015') > > I think the former is clearer, since that's what we were writing before. The latter however appears more portable at least to traditionalists ;-)