i am trying to capture the output of the command fuser into an array in shell script.
based on other similar queries I used below lines in shell.
p_list = ( $("fuser -m /mnt/usb") )
./capture.sh: line 8: syntax error near unexpected token `('
./capture.sh: line 8: ` p_list = ( $(fuser -m /mnt/usb) )'
~# fuser -m /mnt/usb
9261 1089 8526
As with any assignment in bash: no spaces around
p_list=( $(fuser -m /mnt/usb) )