Linuxのcurlでのコマンドオプションの混乱


0

@記号の機能は何でしょうか?以下にコマンドの例を示します。

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


値の先頭にある@記号は、通常、「名前付きファイルから実際の値を読み取る」
-user313114

回答:


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はいくつかの場所で使用しますが、他のコマンドも使用します。


user313114に感謝し、投票して返信を回答としてマークします。curl -hを使用しようとしましたが、投稿した情報が見つかりません。投稿された情報はどこにありますか?:)
林馬
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.