From owner-freebsd-questions@FreeBSD.ORG Thu Aug 14 14:54:10 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9740E37B401 for ; Thu, 14 Aug 2003 14:54:10 -0700 (PDT) Received: from remt28.cluster1.charter.net (remt28.cluster1.charter.net [209.225.8.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEE8743FCB for ; Thu, 14 Aug 2003 14:54:09 -0700 (PDT) (envelope-from chowse@charter.net) Received: from [66.168.145.25] (HELO moe) by remt28.cluster1.charter.net (CommuniGate Pro SMTP 4.0.6) with ESMTP id 120999067 for freebsd-questions@freebsd.org; Thu, 14 Aug 2003 17:54:03 -0400 From: "Charles Howse" To: Date: Thu, 14 Aug 2003 16:53:56 -0500 Message-ID: <001f01c362ae$9001bb50$04fea8c0@moe> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal Subject: SOLVED - Using bc in Bash script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2003 21:54:11 -0000 Got it going. Instead of running daily_report from cron, I will now run the following: ------------------------------------------------------------------------ - #!/usr/local/bin/bash # Time and run the Daily_report \time -ho /root/tmp.time ~/bin/daily_report cat /root/tmp.time | cut -f 2 | cut -c 1-4 >> /root/daily.log cat /root/daily.log | mail -s "Daily Report from Larry" charles ------------------------------------------------------------------------ -- Here's what I get in the mail, note the very last line is the output from \time: Daily Report for Larry for Thursday, August 14 2003. ******************************************** Report begun at: 16:44 Current Operating System ******************************************** FreeBSD 4.8-RELEASE Uptime ******************************************** 4:44PM up 1 day, 5:57, 1 user, load averages: 0.00, 0.00, 0.00 Cron Jobs ******************************************** 58 0 * * * /root/bin/daily_report Logins today ******************************************** root ttyv1 Thu Aug 14 12:02 - 15:38 (03:35) root ttyv1 Thu Aug 14 10:48 - 11:56 (01:07) root ttyv0 Thu Aug 14 08:40 still logged in Accounts with uid = 0 (Superusers) ******************************************** root toor Accounts that have a valid shell ******************************************** root:*:0:0::/root:/usr/local/bin/bash charles:*:1001:1001:Charles Howse:/home/charles:/usr/local/bin/bash Disk Free space ******************************************** Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1a 98M 45M 45M 50% / /dev/ad0s1f 1.8G 346M 1.3G 20% /usr /dev/ad0s1e 197M 1.0M 180M 1% /var /dev/ad3s1e 7.8G 1.1G 6.1G 15% /disk2 procfs 4.0K 4.0K 0B 100% /proc Netstat -an results ******************************************** Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 *.139 *.* LISTEN tcp4 0 0 *.445 *.* LISTEN tcp4 0 0 127.0.0.1.25 *.* LISTEN tcp4 0 0 *.110 *.* LISTEN udp4 0 0 192.168.254.3.138 *.* udp4 0 0 192.168.254.3.137 *.* udp4 0 0 *.138 *.* udp4 0 0 *.137 *.* udp4 0 0 127.0.0.1.123 *.* udp4 0 0 192.168.254.3.123 *.* udp4 0 0 *.123 *.* udp4 0 0 *.514 *.* udp6 0 0 *.514 *.* Active UNIX domain sockets Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr ca1f5be0 dgram 0 0 0 ca1d5f00 0 ca1f5d20 ca1f5d20 dgram 0 0 0 ca1d5f00 0 ca1f5dc0 ca1f5dc0 dgram 0 0 0 ca1d5f00 0 ca1f5f00 ca1f5f00 dgram 0 0 0 ca1d5f00 0 0 ca1d5f00 dgram 0 0 ca1cfdc0 0 ca1f5be0 0 /var/run/log Status of network interfaces ******************************************** tx0: flags=8843 mtu 1500 inet 192.168.254.3 netmask 0xffffff00 broadcast 192.168.254.255 inet6 fe80::2e0:29ff:fe11:ff8a%tx0 prefixlen 64 scopeid 0x1 ether 00:e0:29:11:ff:8a media: Ethernet autoselect (100baseTX ) status: active lp0: flags=8810 mtu 1500 sl0: flags=c010 mtu 552 faith0: flags=8002 mtu 1500 lo0: flags=8049 mtu 16384 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 inet 127.0.0.1 netmask 0xff000000 ppp0: flags=8010 mtu 1500 Last modified ******************************************** Aug 14 16:44 Elapsed time in seconds ******************************************** 0.27 Thanks, Charles