【问题标题】:Trying to make a list in the following format using linux bash commands (awk,cut, or any solution)尝试使用 linux bash 命令(awk、cut 或任何解决方案)按以下格式创建列表
【发布时间】:2019-08-08 07:27:14
【问题描述】:

我一直在尝试列出我的本地服务器列表,其中包含我这边的自动化流程的凭据。这是我现在拥有的文件:

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,下面的密码不是真实的,仅以它们为例。现在,我想要完成的是获取一个包含以下格式信息的“list.txt”:

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

任何帮助将不胜感激,

谢谢!

【问题讨论】:

    标签: bash awk sed cut


    【解决方案1】:

    看看

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

    【讨论】:

      猜你喜欢
      • 2013-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多