Home > Blockchain >  I'm trying to put the output of the variable but it's getting an error
I'm trying to put the output of the variable but it's getting an error

Time:07-21

I am trying to get the stylus id number of my device and I can't assign it in a variable. If I echo it, the line of code is working.

GETSTYLUSID=`xsetwacom list devices`
echo $GETSTYLUSID | cut -d " " -f 7

IDSTYLUS=$GETSTYLUSID | cut -d " " -f 7

echo "put it in idstylus: $IDSTYLUS"

CodePudding user response:

IDSTYLUS=$(echo $GETSTYLUSID | cut -d " " -f 7)
  •  Tags:  
  • bash
  • Related