3 ms·
The -n flag keeps echo from emitting a line ending.
by fwip 7y ago
The -n flag keeps echo from emitting a line ending.
- dylan604 7y agodoh! I read it as \n, but then that's for other languages, so i was just all sorts of not paying attention
- mappu 7y agoI used a distro in recent memory where `echo -n foo` really produced `-n foo`. The workaround was `printf "%s" foo`.
- fwip 7y agoAh yeah, posix doesn't require -n to do anything in particular. For most use cases, strict adherence to posix compatibility isn't important, but sometimes it really really is.