some modification on instpkg
[cmdllinux.git] / scripts / _ls_proc_execs2.sh
blob628da066a89ce3ebfa80cfbb0be63c65bdfd5cc1
1 [ "$1" = "-pid" ] && printpid=1
2 cd /proc
3 if [ "$printpid" = 1 ]; then
4 ls -l [0-9]*/exe 2> /dev/null | sed -n 's%^.* \([0-9]\+\)/exe -> \(.*\)$%\1 \2%p'
5 else
6 ls -l [0-9]*/exe 2> /dev/null | sed -n 's%^.* -> \(.*\)$%\1%p'
7 fi