I am trying to write a script where I am executing
connmanctl services
it gives me:
A0 Wired ethernet_abcdefghijkl_cable
I want to extract ethernet_abcdefghijkl_cable and put it in a variable.
How can I do that?
I tried following so far but didn't work:
x="$(connmanctl services)"
echo "$x" | cut -d' ' -f 3
cutcommand return ? Its working for me, perhaps you may want to append2>&1toconnmanctlcommand. Its possible that its printing to stderr ,although I am not sure.