Search Results

Search: Posts Made By: Marti95
13,752
Posted By Marti95
perfect! Now its working
perfect!
Now its working
13,752
Posted By Marti95
Hello Thanks for your answer ...
Hello

Thanks for your answer






This is How the Array Looks:

declare -p
declare -A ENTRIES='([415,COMMENT]="# CentOS " [55,HOST1]="123imm1" [55,HOST2]="imm1" [414,IP]="# x.x.x.41 -...
13,752
Posted By Marti95
Thanks for your answer. But this does not work....
Thanks for your answer. But this does not work. It gives me nothing back.
13,752
Posted By Marti95
I attachet my script. Its written in german....
I attachet my script.

Its written in german.
Quesiton for yes and no: j=yes n=no


use "j" (yes)

It generates you a hosts file.

#!/bin/bash
#...
13,752
Posted By Marti95
I dont want to use tabs. Because the hostsfile...
I dont want to use tabs. Because the hostsfile can't get read correctly with tabs.
Also is the problem that the spaces between [IP] [HOST1] [HOST2] is not the same for each line. Maybe once is [IP]...
13,752
Posted By Marti95
Hostsfile generator
Hello

I use a bash script to creating the hosts file /etc/hosts

But there is a bug inside my output and I want to fix this.

My Array looks like this:
205,IP 111.122.133.20 ...
5,302
Posted By Marti95
Thank you so much This works perfect for me:...
Thank you so much

This works perfect for me:
IFS=$'\n'
echo "${!ENTRIES }" | sort -t, -k1,1n -k2,2.2r -k2.3 | while read IX; do printf "%-20s\n" ${ENTRIES[$IX]}; done | paste -sd"\t\t\t\n"
5,302
Posted By Marti95
Oh it was my fault. Its working of course as...
Oh it was my fault. Its working of course as well. Thank you

So know i dont understand (my bash skills are very low) how to get this in a file line by line in this format
# IP - HOST1 - HOST2 -...
5,302
Posted By Marti95
Your method is not working, this is what i get...
Your method is not working, this is what i get back
414,IP 205,HOST1
205,HOST2 414,COMMENT
505,HOST2 505,IP
505,HOST1 1025,COMMENT
775,COMMENT 1015,IP
1025,IP ...
5,302
Posted By Marti95
Thank you for your answers And sorry for the...
Thank you for your answers

And sorry for the few informations.
I used bash #!/bin/bash


I have to sort this nummeric.
After sorting I want to give this out in a File
In this order
# IP -...
5,302
Posted By Marti95
Sort multidimensional Array
Hello

I have a problem.
I create a Multidimensional Array Like this:
ENTRY["HOST1"]="$kunnum-$host"
ENTRY["HOST2"]="$host"
ENTRY["COMMENT"]="# $3"
for key in...
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 12:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy