help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Beautify and reformat a complicated shell script with Emacs for readabil


From: Hongyi Zhao
Subject: Beautify and reformat a complicated shell script with Emacs for readability.
Date: Fri, 29 Jan 2021 22:02:16 +0800

I have a shell script which includes the following complicated code snippet:

while :; do
  curl -X POST https://dnsapi.cn/Record.Ddns \
       -d "$(
         curl -s -X POST https://dnsapi.cn/Record.List \
              -d
'login_token=id,tocken&format=json&domain=hyddns.xyz&sub_domain=free'
|
                 jq '

"login_token=209395,153bdabe92e6c4212280b7a764967a72&format=json&domain_id="
+ .domain.id
                    + (.records[] | select(.name == "free") |
"&record_id=" + .id + "&record_line_id=" + .line_id +
"&sub_domain=free" )
                    ' |
                 sed -re 's/^"//;s/"$//'
       )" | jq .
  sleep 30
done

I want to beautify and reformat this complicated code snippet with
Emacs automatically for readability. Is it possible?

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China



reply via email to

[Prev in Thread] Current Thread [Next in Thread]