Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backward compatibility #3

Open
grylem opened this issue Jan 10, 2022 · 4 comments
Open

Backward compatibility #3

grylem opened this issue Jan 10, 2022 · 4 comments

Comments

@grylem
Copy link

grylem commented Jan 10, 2022

Hi
macOS version o the ed must be posix compliant

printf %s\n H '# test' q | ed
?
script, line 2: unknown command

your versions works like gnu ed

printf %s\n H '# test' q | ed
no any messages

if add -G still works like gnu ed, is that how it should be? If yes, how to use your version of ed as posix compatible?

@slewsys
Copy link
Owner

slewsys commented Jan 10, 2022

Support for comments is not traditional in ed, so:

printf "%\n" H '# test' | ed -G

should really print an error. I'll correct that. Thank you!

@slewsys
Copy link
Owner

slewsys commented Jan 10, 2022

By the way, macOS ed actually quits, which is incorrect. When ed reads commands from a pipe, the traditional behavior is to reports errors, but not exit. A lot of scripts depend on this behavior. macOS ed is actually an early version of my code, from before this was corrected. Unfortunately, there's no way to fix it now :(

@grylem
Copy link
Author

grylem commented Jan 10, 2022

Thanks for explanaion.

P.S.
in manpage and texinfo file info about options as -eIRx are missed. Please fix it.

@slewsys
Copy link
Owner

slewsys commented Jan 10, 2022

Yeah, the documentation needs a lot of work. In the mean time, the file doc/SUSv4.md does a little better job of covering extensions.

HEAD of branch without-gnulib should now be in sync with main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants