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
# BUG: sub-command isn't functioning, throws a 'grep' is a garbage error# but if you run the cmd as it is without the outside (), it works just fine# need to scour forums and post a question on stack overflow# I'm sure it's something to do with the way variables and quotes are parsed and# interpolated in the sub-command
NICS+=(${CMDs[IP]} link show | grep ^[^1]: | cut -d'' -f2 | tr ':''\n'| awk NF)
${IP_CMD}
Error: either "dev" is duplicate, or "grep" is a garbage.
The text was updated successfully, but these errors were encountered:
Using bash's 'eval' cmd against the variable holding the 'ip link show' command clears the issue. Why is that?
$ $IP_CMD
Error: either "dev" is duplicate, or "grep" is a garbage.
$ echo$IP_CMD
/usr/bin/ip link show | grep ^[^1]: | cut -d'' -f2 | tr ':'''
$ eval$IP_CMD
enp0s31f6
wlp2s0
The text was updated successfully, but these errors were encountered: