I have a script bash to add users from a .txt file. It is really simple:
name firstname uid gid
space separated values
I want to check
You can use:
awk 'res = NF!=4{exit} END{exit !res}' file
This will exit with 1 if all rows have 4 columns otherwise it will exist with 0
1
0