Date: Tue, 22 Jan 2002 15:32:55 -0800 (PST) From: <iedowse@FreeBSD.org> To: root@ntstn.sasknow.com, iedowse@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: bin/16657: /bin/hostname: New feature to return subcomponents of hostname Message-ID: <200201222332.g0MNWt129325@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
Synopsis: /bin/hostname: New feature to return subcomponents of hostname State-Changed-From-To: open->closed State-Changed-By: iedowse State-Changed-When: Tue Jan 22 15:23:10 PST 2002 State-Changed-Why: Such an option to hostname would be of extremely limited use, and it is just not the unix way of doing things; we have utilities such as sed, awk, cut etc. for this very reason. In your case, you could use hostname | awk -F. '{print $(NF-1) "." $(NF)}' and as always, there are many other ways that work too. http://www.FreeBSD.org/cgi/query-pr.cgi?pr=16657 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201222332.g0MNWt129325>