Getting last line
How can I get the last line of a file? I need to sort the user ids by number order and store them in a file. (awk -F: '{ print $3 }' /etc/passwd | sort -n -u > /etc/TMPFILE). What command can I use to see the last uid? Thanks.
Since I'm here... I need to write a script to add a new user. My idea is breaking it down. Prompt for username, give it a userid, groupid, home dir, etc. storing each as a variable. At the end, it takes each varible adds in :'s and pastes it at the end of the passwd file. How would you go about this? I am not looking for a script, just ideas. |
tail -1 ?
|
All times are GMT -5. The time now is 10:44 AM. |