I’m trying to get a simple output of the settings for a local account in Linux from /etc/shadow.
tools:!!:16567:7:90:14:::
So the user “tools” has a minimum password life of 7 days and a maximum password life of 90 days. I basically want my relevance just to read the minimum password setting. I found a post on the old forums that used regex to grab it but I couldn’t make it work.
The “:!!:” signifies accounts that are disabled but not all accounts are disabled which is why I need to determine this value. If the account is not disabled, there is a long hash value that varies by account. I removed to keep the info secure. I tried something like this:
tuple string item 4 of (substrings separated by ":" of line whose (it starts with "tools") of file "shadow" of folder "/etc")
This reads the results how I want but it’s not choosing the fourth item of the result. I’ve never been good with tuples.
Now here is the issue. The substring relevance seems to give me the answer I want:
Q:(substrings separated by ":" of line whose (it starts with "tools") of file "shadow" of folder "\etc")
A: tools
A: !!
A: 16567
A: 7
A: 90
A: 14
A:
A:
A:
T: 0.458 ms
When I select the tuple items, I also get the desired result:
Q: tuple string items of (substrings separated by ":" of line whose (it starts with "satools") of file "test.txt" of folder "C:\Users\xeebk62\Desktop")
A: satools
A: !!
A: 16567
A: 7
A: 90
A: 14
T: 0.529 ms
But when I try to select a specific tuple item, I get this:
Q: tuple string item 3 of (substrings separated by ":" of line whose (it starts with "tools") of file "shadow" of folder "/etc")
E: Singular expression refers to nonexistent object.