id
(a command) is not the same as ${id}
(a variable reference); and id
does not return the same thing as xdo ... || xdo ...
Assuming the variable id
has your hex codes, and said codes are separated by a space, you can use parameter expansion to pull the first hex code, eg:
$ echo ${id%% *}
0x04000007
## or
$ echo ${id// */}
0x04000007
## or
$ echo ${id// *}
0x04000007
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…