Added nb-users and uptime scripts.

This commit is contained in:
Raphaël Pinson 2009-04-02 17:18:17 +02:00
commit 5f1598f6ae
2 changed files with 46 additions and 0 deletions

23
bin/nb-users Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh -e
#
# nb_users: print the number of users on the machine
# Copyright (C) 2009 Raphaël Pinson.
#
# Authors: Raphaël Pinson <raphink@ubuntu.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
uptime | sed -e "s/.*, *\(.* user[s]*\), .*/\1/"

23
bin/uptime Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh -e
#
# uptime: condensed uptime of the machine
# Copyright (C) 2009 Raphaël Pinson.
#
# Authors: Raphaël Pinson <raphink@ubuntu.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
uptime | sed -e "s/.* up *\(.*\), *.* user[s]*, .*/\1/; s/ day[s]*, */d/"