티스토리 뷰

공부

[Sh] Assign output to variable

승가비 2020. 4. 16. 22:04
728x90
#!/bin/bash

IP=$(curl automation.whatismyip.com/n09230945.asp)

echo "$IP"

https://stackoverflow.com/questions/8737638/assign-output-to-variable-in-bash

 

Assign output to variable in Bash

I'm trying to assign the output of cURL into a variable like so: #!/bin/sh $IP=`curl automation.whatismyip.com/n09230945.asp` echo $IP sed s/IP/$IP/ nsupdate.txt | nsupdate However, when I run the

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[Sh] date loop  (0) 2020.04.17
[Linux] IP  (0) 2020.04.16
[oozie] [yyyy-mm-dd't'hh:mm+0900] mask  (0) 2020.04.16
[JS] echartJS  (0) 2020.04.16
[Sh] curl parse JSON String  (0) 2020.04.16
댓글