I would like to substitute the number of some process to find out its commandline as follows:
> cat /proc/"`fuser /dev/ttyS0`"/cmdline
cat: /proc/5231 /cmdline: No such file or directory
but it looks like fuser
adds an extra whitespace to the PID. Any idea how to get this right, or solve otherwise?
Expected behavior: I want to get a process ID using fuser
and in a second step display /proc/<id>/cmdline
.