Re: field extraction ala awk
- Posted by ghaberek (admin) Feb 25, 2019
- 1154 views
sash said...
For instance, how would one extract fields into variables, from something like an /etc/passwd file? Or any file using same format.
That's easy! In this case split() works perfectly fine. Here's another contrived example: https://openeuphoria.org/pastey/299.wc
Edit: here are some helpful links:
- https://www.cyberciti.biz/faq/understanding-etcpasswd-file-format/
- https://www.cyberciti.biz/faq/understanding-etcshadow-file/
- https://www.cyberciti.biz/faq/understanding-etcgroup-file/
-Greg