[Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

Cousin Stanley cousinstanley at gmail.com
Fri Nov 9 13:16:53 EST 2018


srinivasan wrote:

> Even after changing as per the below
> "blkid -o export %s | grep 'TYPE' | cut -d'=' -f3"
> or:
> 'blkid -o export %s | grep "TYPE" | cut -d"=" -f3'
> or:
> "blkid -o export %s | grep \"TYPE\" | cut -d\"=\" -f3"
> 
> Still my output is:
> */dev/mmcblk1p1: LABEL="efi" UUID="1084-AA42" TYPE="vfat"*
> 
> My expected output should be only:
> *vfat*
> 
> Could you guys please do the needful?

 
  I tried a simiar command line from a rock64 sbc shell
  and found that  -f2  instead of  -f3  returned only  vfat ....
   

-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona




More information about the Python-list mailing list