You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to assign the dns result to dns_server by networksetup -getdnsservers Wi-Fi in the shellscript, but after I format it, the formatter replace `` into $(), show as below:
before format:
dns_server=`networksetup -getdnsservers Wi-Fi`
after format:
dns_server=$(networksetup -getdnsservers Wi-Fi)
The text was updated successfully, but these errors were encountered:
this is upstream issue, https://github.com/mvdan/sh/issues
you can query the cause from the author.
I think $(…) is much clearer and easier to use when nesting.
@foxundermoon could this issue please be reopened? It seems that $() and `` are not always interchangeable., and converting one to the other may break existing code.
An example:
input="ap-southeast-2c"echo`echo $input| sed -e 's:\([0-9]\)[a-z]*\$:\\1:'`#ap-southeast-2echo$(echo $input| sed -e 's:\([0-9]\)[a-z]*\$:\\1:')#ap-southeast-2c
I want to assign the dns result to
dns_server
bynetworksetup -getdnsservers Wi-Fi
in the shellscript, but after I format it, the formatter replace `` into$()
, show as below:before format:
after format:
The text was updated successfully, but these errors were encountered: