repo.or.cz
/
cmdllinux.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
some updates
[cmdllinux.git]
/
scripts
/
_ls_proc_execs.sh
blob
e7f7f2d2bc2ea8e0f87a014f4f7a9a2f1e294345
1
[
"
$1
"
=
"-printenv"
] &&
prenv
=
1
2
3
for
i
in
/
proc
/[
0
-9
]*/
exe
;
do
4
if
LNK
=
$
(
readlink
$i
2
> /
dev
/
null
);
then
5
A
=
${i%/exe}
6
echo -n
"
${A##*/}
"
7
echo
"
$LNK
"
8
if
[ !
-z
"
$prenv
"
];
then
9
cat
$A
/
environ |
tr
"\0"
"
\n
"
|
xargs
-r -i
bash
-c
'[[ "{}" =~ ^.*=.*$ ]] && echo "
\"
{}
\"
"'
10
fi
11
fi
12
done