回答編集履歴

2

回答修正: curlコマンドの-sまで消してしまったのを復活

2020/01/16 05:09

投稿

Y.H.
Y.H.

スコア7914

test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  ```bash
10
10
 
11
- res=`curl -L google.com -w '\n%{http_code}'`
11
+ res=`curl -L google.com -w '\n%{http_code}' -s`
12
12
 
13
13
  body=`echo "$res" | sed '$d'`
14
14
 

1

回答修正: curlコマンドのオプションが冗長だったので修正

2020/01/16 05:09

投稿

Y.H.
Y.H.

スコア7914

test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  ```bash
10
10
 
11
- res=`curl -L google.com -o - -w '\n%{http_code}\n' -s`
11
+ res=`curl -L google.com -w '\n%{http_code}'`
12
12
 
13
13
  body=`echo "$res" | sed '$d'`
14
14