Самый легкий путь состоит в том, чтобы сделать это на двух шагах, сначала найти самую широкую строку:
max=$(awk 'max < NF { max = NF } END { print max }' infile)
Затем используйте это в качестве входа при заполнении других столбцов:
awk -v max=$max '{ for(i=NF+1; i<=max; i++) $i = "N/A"; print }' infile
`w U1` - login informations for example for user U1 you can see in output something like this
User tty login@ idle JCPU PCPU what
также можно сделать сценарий удара и вставить crontab, например, чтобы быть выполненными несколько раз в один день, с varibles w U1, w U2, w U3 и превратить некоторый otput в файл также
`/var/run/utmp` - List of current login sessions.
`/var/log/wtmp` - List of previous login sessions
`/var/log/btmp` - List all the bad login attempt
У меня нет ответа для ограничения общего количества времени потраченным. Для ограничения на основе часов дня, тем не менее, pam_time
вероятно, что Вы хотите.
Из страницы справочника:
The pam_time PAM module does not authenticate the user, but instead it
restricts access to a system and or specific applications at various
times of the day and on specific days or over various terminal lines.
This module can be configured to deny access to (individual) users
based on their name, the time of day, the day of week, the service they
are applying for and their terminal from which they are making their
request.
ac
получить общее количество logint ime. Это не принимает время простоя во внимание, все же. – Jenny D 14.01.2014, 07:52