| Summary: | /bin/hostname: New feature to return subcomponents of hostname | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Ryan Thompson <ryan> |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 3.4-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Ryan Thompson
2000-02-11 22:40:02 UTC
State Changed
From-To: open->closed
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.
|