Skip to content

6.7.3 获取线上证书语法错误 #10

Description

@Andy0570
  1. 下载 GitHub 站点的服务器证书链:
$ openssl s_client -connect www.github.com:443 -shwocerts 2>&1 </dev/null \
  | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \
  > www_fullchain.pem
  1. 执行拆分操作存在错误输出:
# 将证书链文件拆分成各个文件
$ cat www_fullchain.pem | awk 'split_after==1{n++;split_after=0} \
  /-----END CERTIFICATE-----/ {split_after=1} \
  {print > "www_cert" n ".pem"}'
awk: syntax error at source line 3
 context is
	  {print > "www_cert" >>>  n <<<  ".pem"}
awk: illegal statement at source line 3

命名行提示输出步骤存在语法错误,请问如何解决?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions