anyway of shortening the following?

From: William (fred_at_nosmapherethankyou.com)
Date: 06/07/05


Date: Tue, 7 Jun 2005 09:16:54 +0000 (UTC)

Hi all,

Can the following be shortened in any way to achieve the same output?

uptime | awk '{print "Uptime information for this Host: " $2, $3,
$4,"since: " $5}' | sed 's/[,/]//'g
Uptime information for this Host: up 48 day(s) since: 22:31

I'd also like to, (if possible?) replace "Host" in the output with a either
a declared variable or by running the `hostname` command in Solaris within a
script.

HOST=`hostname`
echo `hostname`

--
Regards
William


Relevant Pages

  • Re: domain name
    ... I never had a problem with the hostname. ... troubles when the host is a server on the 'Net with a static IP and ... Seems to me it should return "localhost" in that case, ... configuration internally consistent with a private configuration in ...
    (Debian-User)
  • Re: hostnames and interfaces
    ... Apache documentation on doing virtual hosts and maybe do some ... A fully Qualified Host Name consists of two main parts. ... During installation, when it asks for hostname, it wants a Fully ... service what DNS server will be providing DNS service for that domain. ...
    (freebsd-questions)
  • Re: /bin/hostname
    ... Find a real news server. ... in /etc/hosts that maps the host and the FQDN to the static IP ... Linux distributions are supposed to follow Linux Standard Base standards, ... hostname -- show or set the system's host name ...
    (comp.os.linux.networking)
  • RE: apache not starting: FreeBSd 5.4
    ... Assigning a Host name to your FBSD system. ... statement hostname= to /etc/rc.conf. ... registered domain name on the public Internet (unless of course it's ...
    (freebsd-questions)
  • Re: /bin/hostname
    ... internet server with a static IP address, and there needs to be a line ... in /etc/hosts that maps the host and the FQDN to the static IP ... Linux distributions are supposed to follow Linux Standard Base standards, ... hostname -- show or set the system's host name ...
    (comp.os.linux.networking)