Sponsored Content
Full Discussion: Hostsfile generator
Top Forums Shell Programming and Scripting Hostsfile generator Post 303041004 by RudiC on Tuesday 12th of November 2019 04:57:16 AM
Old 11-12-2019
Hmmm - I missed to post the necessary IFS modification. Try again with this slightly modified version:
Code:
IFS=$'\n'

for IN in $(echo "${!ENTRIES[*]}" | tr ',' '\n' | sort -un)
  do    [ ! "${IN/[A-Z]}" = "$IN" ] && continue
        printf "%s %s %s %s\n" "${ENTRIES[$IN",IP"]}" "${ENTRIES[$IN",HOST1"]}" "${ENTRIES[$IN",HOST2"]}" "${ENTRIES[$IN",COMMENT"]}"
  done

This User Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Cybersecurity

Password Generator

I need a great Password Generator program. I looked at a few of them, but none of them seemed to be what I wanted. So I have decided to write my own. (That's the cool thing about being a programmer....I always get what I want in software :) ) Do you have any password generators that you... (13 Replies)
Discussion started by: Perderabo
13 Replies

2. UNIX for Dummies Questions & Answers

date generator

Is there a command to generate the unix date that is in theshadow file?>? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

3. Shell Programming and Scripting

How to compare result lpstat with hostsfile

Hi there all, I got a long list of printers installed and a longer list of printers in my hosts file. In the hosts file I got a even longer list of printers in the hosts file I got the IP adress of all printers next to the printer name. How can I get a script working to get the printers... (0 Replies)
Discussion started by: draco
0 Replies

4. Shell Programming and Scripting

Range generator

Dear All, I have a sorted file like 1 2 3 8 9 10 45 46 47 78 The output will be range like 1 3 8 10 45 47 78 78 (9 Replies)
Discussion started by: saifurshaon
9 Replies

5. Shell Programming and Scripting

Random Sentence Generator

Hi, I need to create a table with random sentences. I need lines that are upto 1000 characters in lenght. I need a random sentence generator that will create sentences and output it to a text file. The sentences should be of lenght varying from 1 to 1000. Does anyone know how this can be... (7 Replies)
Discussion started by: kaushys
7 Replies

6. What is on Your Mind?

Barcode Generator

QR Code Generator (0 Replies)
Discussion started by: Neo
0 Replies

7. Shell Programming and Scripting

time generator

Hi experts, I'd like to generate the table/file containing: number of milliseconds elapsed since midnight till midnight. It should contain 5 columns (hours minutes seconds milliseconds): Table will have theoretically 86 400 000 rows. My question is , is there somewhere the file or source... (7 Replies)
Discussion started by: hernand
7 Replies

8. Shell Programming and Scripting

Sequence generator

Thanks Guys This really helped (5 Replies)
Discussion started by: robert89
5 Replies

9. Shell Programming and Scripting

Generator script

Hello again unix.com people, I need your help again. I'm currently need a script that will generate ip ranges... lets say from 64.1.1.1 to 74.255.255.255 and the output should be like this: 64.1.1.2 64.1.1.3 ............. ............. 74.255.255.254 74.255.255.255 (line-by-line) ... (7 Replies)
Discussion started by: galford
7 Replies
Info::Layer3::Mikrotik(3pm)				User Contributed Perl Documentation			       Info::Layer3::Mikrotik(3pm)

NAME
SNMP::Info::Layer3::Mikrotik - SNMP Interface to Mikrotik devices AUTHORS
Jeroen van Ingen initial version based on SNMP::Info::Layer3::NetSNMP by Bradley Baetz and Bill Fenner SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. my $mikrotik = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myrouter', Community => 'public', Version => 2 ) or die "Can't connect to DestHost. "; my $class = $mikrotik->class(); print "SNMP::Info determined this device to fall under subclass : $class "; DESCRIPTION
Subclass for Mikrotik devices Inherited Classes SNMP::Info::Layer3 Required MIBs HOST-RESOURCES-MIB MIKROTIK-MIB Inherited Classes' MIBs See SNMP::Info::Layer3 for its own MIB requirements. GLOBALS
These are methods that return scalar value from SNMP $mikrotik->vendor() Returns 'mikrotik'. $mikrotik->os() Returns 'routeros'. $mikrotik->model() Tries to extract the device model from "sysDescr". $mikrotik->os_ver() Returns the value of "mtxrLicVersion". Globals imported from SNMP::Info::Layer3 See documentation in SNMP::Info::Layer3 for details. TABLE ENTRIES
These are methods that return tables of information in the form of a reference to a hash. Overrides None. Table Methods imported from SNMP::Info::Layer3 See documentation in SNMP::Info::Layer3 for details. perl v5.12.4 2011-09-28 Info::Layer3::Mikrotik(3pm)
All times are GMT -4. The time now is 06:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy