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

crypt.awk is not finished nor documented. #125

Open
hipcatkiss opened this issue Sep 29, 2024 · 4 comments
Open

crypt.awk is not finished nor documented. #125

hipcatkiss opened this issue Sep 29, 2024 · 4 comments

Comments

@hipcatkiss
Copy link

crypt.awk is old, WIP, no documentation at all. awk is a weird choice anyway. If a bash solution is appropriate (you said you try to avoid it), I can come up with a pull request, documentation and all. Documentation is asciidoc, if that's a problem.

@xplshn
Copy link

xplshn commented Sep 29, 2024

Why bash? sh shall be used for portability's sake, you can call awk from within sh if you need something more powerful.

@classabbyamp
Copy link
Member

awk is a great choice for parsing a line-based text format

@hipcatkiss
Copy link
Author

hipcatkiss commented Sep 29, 2024

@xplshn

Why bash?

bash because it itself is miserable enough to program.

portability

This repository is called "runit init scripts for Void", which portability, exactly, do you mean?

awk

My script doesn't need awk. Only lsblk and a bit of coreutils (head IIRC).

@classabbyamp

awk is less known and I did not find it convenient enough for this specific purpose.

@ahesford
Copy link
Member

Awk is well suited to this task. That a newer generation of Unix users find it obscure is unfortunate, but does not mean that this is a weird choice. Being "old" is not, ipso facto, a valid criticism or justification for replacement.

Bash is definitely not a suitable replacement here. Not all Void installations built on encrypted filesystems will even have bash installed, but all should have an awk implementation. Using POSIX shell would avoid this issue, but a lot of the core parsing task becomes much more cumbersome in shell.

I see no good argument for scrapping the existing crypttab processor in favor of a shell alternative. The best option would be to identify the specific deficiencies of the current parser and rectify them.

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

4 participants