Codice: Seleziona tutto
1 #!/bin/bash
2 ps -e | while read line
3 do
4 pid=$(echo $line | tr -s ' ' | cut -f2 -d' ')
5 eseguibile="$(echo $line | cut -f4 -d)"
6 if [ $(echo $line | tr -d -C '/' | wc -c) -eq 4 ]
7 then
8 echo $pid $eseguibile
9 fi
10 done