Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#1 colliderscope.sh - bash sub-command failing #1

Open
codedChaos opened this issue May 24, 2020 · 1 comment
Open

Issue#1 colliderscope.sh - bash sub-command failing #1

codedChaos opened this issue May 24, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@codedChaos
Copy link
Owner

            # 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.
@codedChaos codedChaos added the bug Something isn't working label May 24, 2020
@codedChaos codedChaos self-assigned this May 24, 2020
@codedChaos
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant