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
pfsinmulti(1)						      General Commands Manual						     pfsinmulti(1)

NAME
pfsinmulti - read several streams of frames and write pfs streams to named pipes SYNOPSIS
pfsinmulti pfsinmulti <file> [--frames f:s:t] [--skip-frames] [<file>...] -- command @1 @2 [@3 ...] DESCRIPTION
Use this command to read several animation sequences and write them to pfsstreams. This command is useful with those pfs programs, which take several pfs streams as arguments. For example, the following command can be used to combine two animations so that there are stitched together: pfsinmulti anim_a-%04d.hdr anim_b-%04d.hdr -- pfscat @1 @2 arguments @1 and @2 are replaced with named pipes for anim_a-%04d.hdr and anim_b-%04d.hdr frames respectively. command argument is obliga- tory and it must be preceded with '--'. There should be as many @1, @2, .., @n arguments as there are animation sequences given as input. Arguments --frames, --skip-frames and other options are handled the same way as in pfsin program. Also pfsinmulti recognizes the same file formats as pfsin. Technically, pfsinmulti creates a named pipe for each pfsstream, replaces @n arguments with the names of those pipes and deletes the pipes when command finishes. EXAMPLES
pfsinmulti image1.hdr image2.hdr -- cat @1 @2 | pfsview Does the same as 'pfsv image1.hdr image2.hdr' but in much more sophisticated way. SEE ALSO
pfsin(1) BUGS
This command currently does not handle multiple frames given with a %d pattern in case of LDR formats: JPEG, PNG, PNM. Please report bugs and comments to Rafal Mantiuk <mantiuk@mpi-sb.mpg.de>. pfsinmulti(1)
All times are GMT -4. The time now is 11:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy