shorten_hostname - tries to shorten hostnames while keeping them meaningful
version 0.006
shorten_hostname [-?dEefl] [long options...] [hostname] [more hostnames...] -? --usage --help Prints this usage information. -l --length the desired length of the hostname string -d --keep_digits_per_domain number of digits per domain -e --domain_edge edge string for truncation of domain -m --cut_middle dont truncate, cut in the middle of domain -f --force force string length (truncate) -E --force_edge edge string for forced truncation of
Hostnames can be specified as additional arguments or on STDIN.
shorten_hostname will try to shorten the hostname string to the length specified. It will cut each domain part to a given length from right to left till the string is short enough or the end of the domain has been reached.
$ shorten_hostname -l 20 saftpresse.bofh-noc.de saftpresse.bof~c.de $ shorten_hostname -l 20 --no-force < t/test_data falcon.lon~n.lon~n.cc.tld r2d2.lon~n.sho~n.cc.tld c3po.sub.sho~n.cc.tld r4p17.sub.sho~n.bla~b.de
The desired maximum length of the hostname string.
Cut each domain part at this length.
If defined this string will be used to replace the end of each domain truncated to indicate that it was truncated.
If enabled the cut will be done one character before the last.
If specified the module will force the length by cutting the result string.
If defined this string will be used to replace the end of the string to indicate that it was truncated.
Markus Benning <me@w3r3wolf.de>
This software is copyright (c) 2014 by Markus Benning.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install String::ShortenHostname, copy and paste the appropriate command in to your terminal.
cpanm
cpanm String::ShortenHostname
CPAN shell
perl -MCPAN -e shell install String::ShortenHostname
For more information on module installation, please visit the detailed CPAN module installation guide.