linux getoptsÃüÁ´¦Àíshell½Å±¾²ÎÊý
#!/bin/bash
while getopts "ab:cd:" Option
# b and d take arguments
#
do
case $Option in
a) echo -e "a = $OPTIND";;
b) echo -e "b = $OPTIND $OPTARG";;
c) echo -e "c = $OPTIND";;
d) echo -e "d = $OPTIND $OPTARG";;
esac
done
shift $(($OPTIND - 1))
Ïà¹ØÎĵµ£º
LinuxÍøÂç¹ÜÀíԱӦƸ¿¼ÊÔÌ⣨º¬´ð°¸£©
Ò»£®Ìî¿ÕÌ⣺
£¨¼Ó´ÖµÄÎÄ×ÖΪ¸ÃÌâµÄ´ð°¸£©
1. ÔÚLinuxϵͳÖУ¬ÒÔ Îļþ
·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ /etc/fstab
ÖжÁÈ¡Òª¼ÓÔصÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓà i½Úµã
À´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪÒýµ¼¿é ¡¢×¨ÓÃ¿é ¡¢ i½Úµã±í¿é ......
O.S ʹÓÃGnu gprof½øÐÐLinuxƽ̨ϵijÌÐò·ÖÎö
¹Ø ¼ü ´Ê£ºgprof callgraph º¯ÊýÏûºÄµÄʱ¼ä LinuxÓ¦Ó÷ÖÎö
ÔĶÁÌáʾ£º±¾ÎĽéÉÜÁËÈçºÎʹÓÃGnu gprof ¶ÔLinuxƽ̨ϵÄÏÖÓгÌÐò½øÐÐÓÅ»¯·ÖÎöºÍÉú³É³ÌÐòµ÷ÓÃͼ¡£Ö÷ҪƫÖØÓÚ¶ÔÉú³ÉºÍʹÓÃÁ÷³Ìͼ×÷½éÉÜ¡£
Gprof ¼ò½é:
Gprof¹¦ÄÜ£º´òÓ¡³ö³ÌÐòÔËÐÐÖи÷¸öº¯ÊýÏûºÄ ......
ÔÚÒ»¸ö³ÌÐò±ÀÀ£Ê±£¬Ä¬ÈÏÇé¿öÏÂÊDz»²úÉúcoreÎļþ¡£
ÏÂÃæµÄÃüÁî¿ÉÒÔ¼ì²éÉú³ÉcoreÎļþµÄÑ¡ÏîÊÇ·ñ´ò¿ª:
$ulimit -a¸ÃÃüÁÏÔʾËùÓеÄÓû§¶¨ÖÆ£¬ÆäÖÐÑ¡Ïî-a´ú±í“all”¡£
$ulimit -c unlimitedÀ´ÈÃÌض¨µÄÓû§¿ÉÒÔ²úÉúcoreÎļþ
coreÎļþ½ö½öÊÇÒ»¸öÄÚ´æÓ³Ïó(ͬʱ¼ÓÉϵ÷ÊÔÐÅÏ¢)£¬Ö÷ÒªÊÇÓÃÀ´µ÷ÊԵġ£Èç¹ûÄú¸ù±¾¾Í²»Ïë ......
windowsÖ÷»úºÍLinuxÐéÄâ»úÉèÖÃÎļþ¼Ð¹²Ïí
µÚÒ»²½£º´ò¿ªÐéÄâ»ú µãvm-----install vmtools
µÚ¶þ²½£º¿ªÊ¼ÐéÄâ»úLinux
ÔÚÖն˼üÈëÒ»ÏÂÃüÁî
cp /mnt/cdrom/VMwareTools-6.0.0-45731.tar.gz /usr/tmp
cd /usr/tmp
tar xzvf VMwareTools-6.0.0-45731.tar.gz
cd vmware-tools-distrib
./vmware-install.pl
һ·»Ø³µ£¬µÈ¿´µ ......
#ifndef __KERNEL__
#define __KERNEL__
#endif
#ifndef MODULE
#define MODULE
#endif
#include<linux/config.h>
#include<linux/module.h>
#include<linux/version.h>
#include<linux/init.h>
#include<linux/kernel.h>
#include<linux/errno.h>
#include<linux/sche ......