Sponsored Content
Full Discussion: Grouping hostnames for pdsh
Top Forums Shell Programming and Scripting Grouping hostnames for pdsh Post 302976818 by RudiC on Wednesday 6th of July 2016 12:30:59 PM
Old 07-06-2016
Code:
awk '
                {HN = $1
                 sub (/[0-9]*$/, _, HN)
                 sub (/^[a-z]*/, _, $1)
                }
NR == 1         {printf "%s[%04d-", HN, $1
                }
NR > 1 &&
$1+0 != LAST+1    {printf "%04d,%04d-", LAST, $1
                }
                {LAST = $1
                }
END             {printf "%04d]\n", $1
                }
' file
hostname[1000-1004,2000-2002,0100-0102]

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

newbie question about hostnames

When I log into bash it will say my username @localhost I wondering how do I change localhost to another such as draco.I've the using the hostname command as root but it changes back to localhost after I reboot.I was wondering how would I hide my ISP hostname in linux.Because when I log into an IRC... (1 Reply)
Discussion started by: angelfly
1 Replies

2. IP Networking

DHCP and Hostnames

I have a linksys DSL router. I run a mixed environment of Windows, Linux and Solaris. The routers dhcp tables show the windows machines hostnames and associated IP's ok but the unix bases mahines don't have associated hostnames in the DHCP tables. I can ping by IP but not my the machines... (5 Replies)
Discussion started by: mr16ga
5 Replies

3. Shell Programming and Scripting

Scripting nslookup to resolve multiple hostnames

Hi Friends, I have a list of servers with their production names in a file. I want to know the best way eiter a command or a script that can do the following :- Append "-bkp" to each hostnames at the end And run nslookup and make sure I have valid backup IP add assigned to it. Any... (1 Reply)
Discussion started by: new2prog
1 Replies

4. Shell Programming and Scripting

regex help to get unique hostnames

Hi I have a file containing hostnames like this (host=myhost.domain.com) or (host=myhost) i need to extarct the unique hostnames without the domain names from that file. so my output should be myhost (without domain names) But my regex skills are rusty i tried grep "host"... (4 Replies)
Discussion started by: xiamin
4 Replies

5. Shell Programming and Scripting

Compare file of hostnames with table in MySQL DB

Hi all, i have a list of files that contains some PC hostname, then i need to enumerate every hostname and check if there's a table with same name of the hosts in MySQL database XYZ. I need this because have to decide automatically if i have to make a create table or a insert into an existent... (2 Replies)
Discussion started by: maxlamax
2 Replies

6. UNIX for Dummies Questions & Answers

Is there a unix command to find ALL hostnames for an ip address?

I am trying to determine if there are several url/host names for an IP address. Is there a UNIX command to find ALL host names for an IP address? Thank you in advance. (3 Replies)
Discussion started by: rukasu
3 Replies

7. Programming

Getting All VM Hostnames Using Pysphere

I need to obtain a list of all the hostname of all the VM's that reside on two ESXI servers using pysphere. I have attempted using the basic methods but an unable to get a hostname in my testing using: from pysphere import VIServer server = VIServer() ... (0 Replies)
Discussion started by: metallica1973
0 Replies

8. UNIX for Dummies Questions & Answers

Cyrillic Hostnames?

As the title suggests, I'm wondering if its possible to set a hostname to a name or word with Cyrillic letters (e.g. - Like the Russian alphabet). I tried installing the cyrillic-console package in Debian. I switched my desktop to Russian as well. However, when I try to set the hostname I get that... (2 Replies)
Discussion started by: Azrael
2 Replies

9. Shell Programming and Scripting

Ip address for multiple hostnames

i have a file which has 100 servers,i want a script which can output me ip address and hostname for that server. Thanks in advance!! input file abc.com output file should be abc.com 192.168.1..1 (1 Reply)
Discussion started by: Moon1234
1 Replies

10. Shell Programming and Scripting

Check for valid hostnames

Hello, I am trying to develop a script to check for valid hostnames. Below are the prerequisites for a valid hostname which I got from wiki : Hostnames are composed of series of labels concatenated with dots, as are all domain names. For example, "en.wikipedia.org" is a hostname. Each label... (8 Replies)
Discussion started by: rahul2662
8 Replies
pfscat(1)						      General Commands Manual							 pfscat(1)

NAME
pfscat - Concatenate frames in PFS stream SYNOPSIS
pfscat [--horizontal] [--vertical] [-j <type>] [-R <val>] [-G <val>] [-B <val>] [-Y <val>] [--help] image1.pfs image2.pfs ... DESCRIPTION
Read number of frames as input, stitch them either horizontally or vertically, and produce single frame as output. If frames are not all the same size they are justified with each other - by default they are centered, but can also be flushed with a specified edge. OPTIONS
--horizontal, -H Stitch frames horizontally. --vertical, -V Stitch frames vertically. -j <type> Specify justification of input frames. Predefined types are: min, max, center. -R <val>, -G <val>, -B <val> Color of an extra space in a resulting image. Default color is black, and if some of the components is not specified, its value is set to 0.0. -Y <val> Color of an extra space in luminance mode. --help, -h Print a list of commandline options. EXAMPLES
pfsinmulti anim1_%04d.hdr anim2_%04d.hdr -- pfscat @1 @2 --vertical Stitch two hdr animations in vertical alignment. 'pfscat' is taken as an argument by 'pfsinmulti', therefore it must be preceded with '--'. Number of @1 @2 ... @n arguments must be the same as number of animations to combine. NOTES
Note that either --horizontal or --vertical option must be specified. SEE ALSO
pfsin(1) pfsout(1) BUGS
Please report bugs and comments to Dorota Zdrojewska <dzdrojewska@wi.ps.pl>. pfscat(1)
All times are GMT -4. The time now is 09:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy