Skip to content

Commit 40495b9

Browse files
committed
Remove -e option in awk (#1)
1 parent ef5bdf1 commit 40495b9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

nmcli-cli-ipv4-copy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ ipv4_copy() {
6262
local DEST_IF_NAME=${2:-${SRC_IF_NAME}}
6363

6464
# IP + Method
65-
SRC_IP_SUBNET=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv4.addresses:" | awk -e '{ print $2 }' | tr -d '-')
66-
SRC_METHOD=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv4.method:" | awk -e '{ print $2 }' | tr -d '-')
65+
SRC_IP_SUBNET=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv4.addresses:" | awk '{ print $2 }' | tr -d '-')
66+
SRC_METHOD=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv4.method:" | awk '{ print $2 }' | tr -d '-')
6767
echo_or_execute nmcli connection modify \"${DEST_IF_NAME}\" ipv4.addresses \"${SRC_IP_SUBNET}\" ipv4.method "${SRC_METHOD}"
6868

6969
# Gateway
70-
SRC_GATEWAY=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv4.gateway:" | awk -e '{ print $2 }' | tr -d '-')
70+
SRC_GATEWAY=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv4.gateway:" | awk '{ print $2 }' | tr -d '-')
7171
echo_or_execute nmcli connection modify \"${DEST_IF_NAME}\" ipv4.gateway \"${SRC_GATEWAY}\"
7272

7373
# DNS
74-
SRC_DNS=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv4.dns:" | awk -e '{ print $2 }' | tr -d '-')
74+
SRC_DNS=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv4.dns:" | awk '{ print $2 }' | tr -d '-')
7575
echo_or_execute nmcli connection modify \"${DEST_IF_NAME}\" ipv4.dns \"${SRC_DNS}\"
7676

7777
cat << _EOF_

nmcli-cli-ipv6-copy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ ipv6_copy() {
6262
local DEST_IF_NAME=${2:-${SRC_IF_NAME}}
6363

6464
# IP
65-
SRC_IP_SUBNET=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv6.addresses:" | awk -e '{ print $2 }' | tr -d '-')
66-
SRC_METHOD=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv6.method:" | awk -e '{ print $2 }' | tr -d '-')
65+
SRC_IP_SUBNET=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv6.addresses:" | awk '{ print $2 }' | tr -d '-')
66+
SRC_METHOD=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv6.method:" | awk '{ print $2 }' | tr -d '-')
6767
echo_or_execute nmcli connection modify \"${DEST_IF_NAME}\" ipv6.addresses \"${SRC_IP_SUBNET}\" ipv6.method "${SRC_METHOD}"
6868

6969
# Gateway
70-
SRC_GATEWAY=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv6.gateway:" | awk -e '{ print $2 }' | tr -d '-')
70+
SRC_GATEWAY=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv6.gateway:" | awk '{ print $2 }' | tr -d '-')
7171
echo_or_execute nmcli connection modify \"${DEST_IF_NAME}\" ipv6.gateway \"${SRC_GATEWAY}\"
7272

7373
# DNS
74-
SRC_DNS=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv6.dns:" | awk -e '{ print $2 }' | tr -d '-')
74+
SRC_DNS=$(nmcli connection show "${SRC_IF_NAME}" | grep "^ipv6.dns:" | awk '{ print $2 }' | tr -d '-')
7575
echo_or_execute nmcli connection modify \"${DEST_IF_NAME}\" ipv6.dns \"${SRC_DNS}\"
7676

7777
cat << _EOF_

0 commit comments

Comments
 (0)