Skip to content

Commit

Permalink
Implement 'printf' utility
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AtkinsSJ committed Mar 11, 2024
1 parent 7ebf60c commit b7dfd17
Show file tree
Hide file tree
Showing 4 changed files with 1,035 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/puter-shell/coreutils/__exports__.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import module_man from './man.js'
import module_mkdir from './mkdir.js'
import module_mv from './mv.js'
import module_neofetch from './neofetch.js'
import module_printf from './printf.js'
import module_printhist from './printhist.js'
import module_pwd from './pwd.js'
import module_rm from './rm.js'
Expand Down Expand Up @@ -77,6 +78,7 @@ export default {
"mkdir": module_mkdir,
"mv": module_mv,
"neofetch": module_neofetch,
"printf": module_printf,
"printhist": module_printhist,
"pwd": module_pwd,
"rm": module_rm,
Expand Down
Loading

0 comments on commit b7dfd17

Please sign in to comment.