wow, back again
I am trying to write a program that has many functions, however one of the functions will count the total number of users in the database.
I want to just use wc -l passwd (i've made a copy of passwd to play with, no worries lol)
but I am worried that if any of the accounts contained enough info to be longer than one line of text, it would mess up. Am I correct in my assumption, or does unix read an extended line still as one line?
should I use the 'cut' command to just read the first field? If so, how?
I dunno how different other versions of unix/linux are, but my passwd file is done like this:
root:x:0:0:root:root:/bin/bash
also, how would like to save the number of users as a variable, but not include the name of the file ('wc -l passwd' gives me a reply of # passwd, and i dont want the word passwd to show up)
thanks in advance!