Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

What's wrong with this command:

nmcli c up uuid  "$nmcli -t -f uuid c"

How can I fix it?

"$nmcli -t -f uuid c" is a uuid needed after nmcli c up uuid.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted
nmcli c up uuid  "$(nmcli -t -f uuid c)"

Use backticks or $(cmd) for commmand substitution

Note that nmcli -t -f uuid c can print out more than one uuid. I didn't test it yet, but the command above might not work then. If so, you should make sure that you are using the right uuid like that:

nmcli c up uuid `nmcli -t -f name,uuid c | awk -F':' '/^YOURWIFINAME:/{print $2}'`
share|improve this answer
    
in the second case I prefer to run nmcli c up uuid for all available uuids. I think a for loop may be needed and something that can get each uuid separately as a string. –  Minimus Heximus 2 days ago
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.