Gerald
Gerald

Reputation: 83

Trying to make a list in the following format using linux bash commands (awk,cut, or any solution)

I've been trying to make one list of my local servers containing the credentials to automate process on my side. Here's the file I have right now:

head hosts-only.txt
192.168.2.101
192.168.2.102
192.168.2.103
192.168.2.105
192.168.2.107

head user-only.txt
admin
tomcat
oracle

head pass-only.txt
123456
secret
secure

ofc, password are not real below, just using them as an example. Now, what I am trying to accomplish is getting one 'list.txt' containing the information in the following format:

192.168.2.101:admin:123456
192.168.2.102:tomcat:secret
192.168.2.103:oracle:secure

Any help would be very appreciated,

Thanks !

Upvotes: 0

Views: 51

Answers (1)

Walter A
Walter A

Reputation: 19982

Look at

paste -d: hosts-only.txt user-only.txt pass-only.txt

Upvotes: 2

Related Questions