- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
#!/bin/bash
read str
str=${str//1/2}
str=${str//0/1}
str=${str//2/0}
echo $str
str=${str##*0};
echo $str
exit 0
for pid in `ps -ef | gawk '{ print $2 }'`
do
echo "pid "$pid;
cat /proc/$pid/comm
cmd=`cat /proc/$pid/cmdline`
echo ''
for fdinfo in `ls /proc/$pid/fd`
do
echo " "$fdinfo
if [ $USER==root ]; then
fd=`ls -l /proc/$pid/fd/$fdinfo | gawk '{ print $11 }'`
else
fd=`ls -l /proc/$pid/fd/$fdinfo | gawk '{ print $10 }'`
fi
owner=`ls -l $fd | gawk '{ print $3}'`
echo " "$fd" pid"$pid" cmdline "$cmd" own "$owner
done
done
gegMOPO4 24.01.2011 15:19 # 0
AliceGoth 25.01.2011 16:32 # 0
xaionaro 12.02.2011 18:37 # 0
Так же стоит отметить "exit 0" в начале програмым, походу программа времено в отладке :)