我正在尝试使用下面的 echo 命令将一些配置复制到 unix 端点,复制后我发现缺少一些字符或有时会得到前缀。示例如下。
这里需要你的建议。
set system login user b48368 authentication encrypted-password '$1$trz5zI9f$2jL1PHnXNxY/'
set system login user b48368 authentication plaintext-password ''
set system login user bb0k93 authentication encrypted-password '$1$/y8uENjM$C7WQQZDQRbRJOeh/'
set system login user bb0k93 authentication plaintext-password ''
set system login user bb0k93 level 'admin'
set system login user bb0r4w authentication encrypted-password '$1$2.i88iIa$ZkREPOKUNjaJflNJ4/'
set system login user bb0r4w authentication plaintext-password ''
set system login user 430140 authentication encrypted-password '$1$qs.a5lXh$zjsssrtmCjsaSIfAv1'
set system login user 430140 authentication plaintext-password ''
set system login user 430140 level 'admin'
set system login user pa3n authentication encrypted-password '$1$yffNZqPG$EpMR/2RxniVYq0'
set system login user pat3n authentication plaintext-password ''
set system login user pa4n authentication encrypted-password '$1$NKWjQnX8$ZExZcYAm7ECEyI2/'
set system login user pa4n authentication plaintext-password ''
set system login user pa5n authentication encrypted-password '$1$8Km21dzm$q2NlHcRlZX1Oc6M0'
set system login user pa5n authentication plaintext-password ''
set system login user pa6n authentication encrypted-password '$1$qjkBDXXU$vJn4o6gF7aK/i/'
set system login user patn authentication plaintext-password ''
set system login user root authentication encrypted-password '$1$T1PHVDEj$UXtfPX/yuGtm0'
set system login user root authentication plaintext-password ''
复制的输出,缺少几个字符
set system login user a48368 authentication encrypted-password 'jL1hU238TJXNxY/'
set system login user a48368 authentication plaintext-password ''
set system login user ab0k93 authentication encrypted-password '$/y8uENjM/'
set system login user ab0k93 authentication plaintext-password ''
set system login user ab0k93 level 'admin'
set system login user ab0r4w authentication encrypted-password '.i88iIa/'
set system login user ab0r4w authentication plaintext-password ''
set system login user 430140 authentication encrypted-password '.a5lXh'
set system login user 430140 authentication plaintext-password ''
set system login user 430140 level 'admin'
set system login user pt3n authentication encrypted-password '/2RxnpQU7CiVYq0'
set system login user pa3n authentication plaintext-password ''
set system login user pa4n authentication encrypted-password '/'
set system login user pa4n authentication plaintext-password ''
set system login user pa5n authentication encrypted-password 'Km21dzm'
set system login user pa5n authentication plaintext-password ''
set system login user pa6n authentication encrypted-password '/oAi/'
set system login user pa6n authentication plaintext-password ''
set system login user root authentication encrypted-password '/yuGtuKm0'
答案1
当您使用 echo 命令时,您很可能将其放在双引号中。这允许对文本进行一些解释 - 特别是 $XXX 被识别为变量 XXX,对它的引用将被替换为该变量的内容(通常为空)。
为了解决这个问题,您需要以不同的方式输入数据或正确地转义字符串 - 您最有可能通过在“$”符号前加上“\”来做到这一点,以确保它被按字面意思解释。
您还没有建议您如何使用它(例如源),但处理它的另一种方法可能是使用“此处有文件“,它允许您将源文件的输入视为原始文本并将其重定向