Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux shell script Àý×Ó1

1. ÈçºÎ»ñµÃ½Å±¾²ÎÊý£º
#!/bin/she
#
while [ -n "$1" ]
do
case "$1" in
-a) echo "found the -a option";;
-b) param="$2"
echo "found the -b option";;
-c) echo "found the -c option";;
--) shift
break;;
*) echo "$1 is not an option";;
esac
shift
done
count=1
for para in "#@"
do
echo "parameter #$count : $para"
count=$[ $count + 1 ]
done
2.ÅжÏÊäÈëÊÇ·ñ·ûºÏÌõ¼þ£º
 #!/bin/sh
#
read input
if [[ $input == r* && ${#input} -eq 10 ]]; then #check the input character bits
echo "yes, your input right."
else
echo "no ,your input error."
fi
3.ÈçºÎÈÃÓû§ÊäÈ룬Èç¹ûÄãÏëµÃµ½Óû§ÊäÈëÒ»¶¨Òª¼ÇµÃread command.
 #!/bin/sh
#
#
read -n1 -t 10 -p "Do you want to continue [Y/N]?" answer
case $answer in
Y | y) echo
echo "fine, continue on ... ";;
N | n) echo
echo "ok, goodbye
exit;;
esac
echo "this is the end of the script"
 4.´ÓÎļþÖжÁ³öÊý¾Ý
#!/bin/sh
#
#
#
count=1
cat testfile | while read line
do
echo "Line $count : $line"
count=$[ $count + 1 ]
done
echo "finished processing the file"
#you can also use the read command to read data stored in a file on the linux system. each call to the read command reads a single line of text from the file. when there are no more lines left in the file,the read command will exit with a non-zero exit status.
5.´´½¨×Ô¼ºµÄÖØ¶¨ÏòÎļþÃèÊö·û
#!/bin/bash
# storing STDOUT, then coming back to it
exec 3>&1
exec 1>test14out
echo "This should store in the output file"
echo "along with this line."
exec 1>&3
echo "Now things should be back to normal"
#This example is a little crazy, so let’s walk through it piece by piece. First, the script redirects file descriptor 3 to the current location of file descriptor 1, which is STDOUT. This means that any output sent to file descriptor 3 will go to the monitor.The second exec command redirects STDOUT to a file. The shell will now redirect any output se


Ïà¹ØÎĵµ£º

Linux(Centos5.4)Éϰ²×°oracle10gR2(10.2.1)

ÎÒÓõÄÊÇCentos5.4 DVD¹âÅ̰²×°µÄlinux²Ù×÷ϵͳ£¬°²×°linuxµÄʱºòÑ¡ÉÏ¿ª·¢¹¤¾ß£¬Xmanager,ÓëÊý¾Ý¿âÏà¹ØµÄ°ü¡£
²Ù×÷ϵͳ°²×°Íê³ÉÖ®ºóÐèÒª½øÐÐһϵÁеÄÅäÖòÅÄܰ²×°oracle10g£¬ÏÂÃæ°ÑÖ÷Òª²½Öè¼Ç¼ÏÂÀ´¡£
1.°²×°Íê²Ù×÷ϵͳ֮ºó»¹ÊÇÓÐЩ°üûÓа²×°£¬È»¶ø°²×°oracle10gµÄʱºòÐèÒªÓõ½£¬Ã»Óа²×°µÄ°üÓÐ:
libXp-1.0.0-8.i386.rp ......

¡¾ÀíÂÛ֪ʶƪ¡¿Linux»ìºÏ±à³Ì+log4cpp


     ÓÉÓÚҪʹÓõ½log4cppµÄ¿â£¬¶ølog4cµÄ×ÊÁÏÊǷdz£µÄÉÙ£¬Ò²ÀÁµÃÈ¥Ñо¿ËüµÄÓ÷¨£¬ÓÚÊǾ;ö¶¨ÊÔÊÔ»ìºÏ±à³ÌÕßÍæÒâ¡£
      Ê×ÏÈÏÈÒýÓÃÏÂC++ËüµÄfather: StroustrupµÄһƪÎÄÕ¡¶C++ Style and Technique FAQ¡·£¨http://www2.research.att.com/~bs/bs_faq2.html£©ÀïµÄһС¸öÆ ......

linuxϵͳµ÷ÓÃ

±¾ÎÄÁгöÁ˴󲿷ֳ£¼ûµÄLinuxϵͳµ÷Ó㬲¢¸½ÓмòÒªÖÐÎÄ˵Ã÷¡£
ÒÔÏÂÊÇLinuxϵͳµ÷ÓõÄÒ»¸öÁÐ±í£¬°üº¬Á˴󲿷ֳ£ÓÃϵͳµ÷ÓúÍÓÉϵͳµ÷ÓÃÅÉÉú³öµÄµÄº¯Êý¡£Õâ¿ÉÄÜÊÇÄãÔÚ»¥ÁªÍøÉÏËùÄÜ¿´µ½µÄΨһһƪÖÐÎÄ×¢Ê͵ÄLinuxϵͳµ÷ÓÃÁÐ±í£¬¼´Ê¹ÊǼòµ¥µÄ×ÖĸÐòÓ¢ÎÄÁÐ±í£¬ÄÜ×öµ½ÕâôÍêȫҲÊǺܺ±¼ûµÄ¡£
°´ÕÕ¹ßÀý£¬Õâ¸öÁбíÒÔman
pagesµÚ2 ......

linux fg bg ctrl + z jobs & µÈÃüÁî


fg¡¢bg¡¢jobs¡¢&¡¢ctrl + z¶¼ÊǸúϵͳÈÎÎñÓйصģ¬ËäÈ»ÏÖÔÚ»ù±¾Éϲ»ÔõôÐèÒªÓõ½ÕâЩÃüÁµ«Ñ§»áÁËÒ²ÊǺÜʵÓõÄ
Ò»¡£& ×î¾­³£±»Óõ½
Õâ¸öÓÃÔÚÒ»¸öÃüÁîµÄ×îºó£¬¿ÉÒÔ°ÑÕâ¸öÃüÁî·Åµ½ºǫִ́ÐÐ
¶þ¡£ctrl + z
¿ÉÒÔ½«Ò»¸öÕýÔÚǰִ̨ÐеÄÃüÁî·Åµ½ºǫ́£¬²¢ÇÒÔÝÍ£
Èý¡£jobs
²é¿´µ±Ç°ÓжàÉÙÔÚºǫ́ÔËÐеÄÃüÁî
ËÄ¡£fg ......

linux°²×°£¨ÐéÄâ»ú£©

linux°²×°£¨ÐéÄâ»ú£©
1.ÄÚ´æÖÁÉÙ256mb
2.Ó²ÅÌÖÁÉÙ2gb£¬ÀíÏëΪ10gbÒÔÉÏ
3.¶àÖØÒýµ¼GRUB
4.IDE¡¢SCSI½Ó¿Ú
    IDE½Ó¿ÚÓ²Å̱ÈSCSI½Ó¿ÚÓ²Å̶ÁдËÙ¶ÈÂýµ«¼Û¸ñÏà¶Ô±ãÒË£¬pc×îΪ³£¼û
    Ò»°ãһ̨»ú×ÓÓÐÁ½¸öIDE½Ó¿Ú£¨IDE0 IDE1£©
    ÿ¸ö½Ó¿Ú¿ÉÒÔÁ¬½ÓÁ¬¸öÓ²ÅÌ£¨Ö÷Å̺ʹÓÅÌ£© ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ