You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.
For example, echo "\n\n\n\n\n" emits only a single newline, because echo always emits a newline after its output. When that string reaches echo as a positional argument, the newline escapes are gone.
As another example, echo "hello\nfriends\n" currently outputs this from a console.log() call:
Just to avoid confusion since the correct output wasn't mentioned, echo "\n" should output the string "\n" literally (i.e. "\n" as a json string) unless the -e flag is specified, in which case it does output a line feed.
AtkinsSJ
added a commit
to AtkinsSJ/phoenix
that referenced
this issue
Mar 11, 2024
This is by no means complete, but covers most of the POSIX spec:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html
- Escape sequences (currently the shell handles these wrong, see
HeyPuter#53 )
- %d %i %o %u %x and %X integer formatters
- %e %E %f %F %g and %G float formatters
- %c and %S string formatters
Still to do:
- %a and %A hexadecimal float formatters
- %b for formatting a string including escape sequences
- Anything beyond the spec that's common and users might expect.
AtkinsSJ
added a commit
to AtkinsSJ/phoenix
that referenced
this issue
Mar 11, 2024
This is by no means complete, but covers most of the POSIX spec:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html
- Escape sequences (currently the shell handles these wrong, see
HeyPuter#53 )
- %d %i %o %u %x and %X integer formatters
- %e %E %f %F %g and %G float formatters
- %c and %S string formatters
Still to do:
- %a and %A hexadecimal float formatters
- %b for formatting a string including escape sequences
- Anything beyond the spec that's common and users might expect.
For example,
echo "\n\n\n\n\n"
emits only a single newline, becauseecho
always emits a newline after its output. When that string reachesecho
as a positional argument, the newline escapes are gone.As another example,
echo "hello\nfriends\n"
currently outputs this from aconsole.log()
call:As you can see,
args
is 'hellofriends' without the escapes.The text was updated successfully, but these errors were encountered: