Linux 上的curl指令選項混亂

Linux 上的curl指令選項混亂

想知道標誌的作用是什麼@?這是一個範例命令,

curl -w "@curl-format.txt" -o /dev/null -s "http://wordpress.com/"

這裡有更多相關背景,

https://stackoverflow.com/questions/18215389/how-do-i-measure-request-and-response-times-at-once-using-curl

答案1

它只是意味著從指定文件中讀取格式。

從手冊:

  -w, --write-out <format>
    Defines  what  to  display on stdout after a completed
and successful operation. The format is a string that may contain
plain text mixed with any number of variables. The string can be 
specified as "string", to get read from a particular file you
specify it "@filename" and to tell curl to read the format from
          stdin you write "@-".

像這樣使用 @ 是相當常見的,curl 在幾個地方使用它,其他命令也是如此。

相關內容