linux shell½Å±¾Ö®ifÅжÏ
ÎÞÂÛʲô±à³ÌÓïÑÔ¶¼Àë²»¿ªÌõ¼þÅжϡ£SHELLÒ²²»ÀýÍâ¡£
if list then
do something here
elif list then
do another thing here
else
do something else here
fi
EX1:
#!/bin/sh
SYSTEM=`uname -s` #»ñÈ¡²Ù×÷ϵͳÀàÐÍ£¬ÎÒ±¾µØÊÇlinux
if [ $SYSTEM = "Linux" ] ; then #Èç¹ûÊÇlinuxµÄ»°´òÓ¡linux×Ö·û´®
echo "Linux"
elif [ $SYSTEM = "FreeBSD" ] ; then
echo "FreeBSD"
elif [ $SYSTEM = "Solaris" ] ; then
echo "Solaris"
else
echo "What?"
fi #ifend
»ù±¾ÉÏºÍÆäËû½Å±¾ÓïÑÔÒ»Ñù¡£Ã»ÓÐÌ«´óÇø±ð¡£²»¹ýÖµµÃ×¢ÒâµÄÊÇ¡£[]ÀïÃæµÄÌõ¼þÅжϡ£
1 ×Ö·û´®ÅжÏ
str1 = str2¡¡¡¡¡¡¡¡¡¡¡¡µ±Á½¸ö´®ÓÐÏàͬÄÚÈÝ¡¢³¤¶ÈÊ±ÎªÕæ
str1 != str2¡¡¡¡¡¡¡¡¡¡ µ±´®str1ºÍstr2²»µÈÊ±ÎªÕæ
-n str1¡¡¡¡¡¡¡¡¡¡¡¡¡¡ µ±´®µÄ³¤¶È´óÓÚ0Ê±ÎªÕæ(´®·Ç¿Õ)
-z str1¡¡¡¡¡¡¡¡¡¡¡¡¡¡ µ±´®µÄ³¤¶ÈΪ0Ê±ÎªÕæ(¿Õ´®)
str1¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ µ±´®str1Ϊ·Ç¿ÕÊ±ÎªÕæ
2 Êý×ÖµÄÅжÏ
int1 -eq int2¡¡¡¡¡¡¡¡Á½ÊýÏàµÈÎªÕæ
int1 -ne int2¡¡¡¡¡¡¡¡Á½Êý²»µÈÎªÕæ
int1 -gt int2¡¡¡¡¡¡¡¡int1´óÓÚint2ÎªÕæ
int1 -ge int2¡¡¡¡¡¡¡¡int1´óÓÚµÈÓÚint2ÎªÕæ
int1 -lt int2¡¡¡¡¡¡¡¡int1СÓÚint2ÎªÕæ
int1 -le int2¡¡¡¡¡¡¡¡int1СÓÚµÈÓÚint2ÎªÕæ
3 ÎļþµÄÅжÏ
-r file¡¡¡¡¡¡¡¡¡¡Óû§¿É¶ÁÎªÕæ
-w file¡¡¡¡¡¡¡¡¡¡Óû§¿ÉÐ´ÎªÕæ
-x file¡¡¡¡¡¡¡¡¡¡Óû§¿ÉÖ´ÐÐÎªÕæ
-f file¡¡¡¡¡¡¡¡¡¡ÎļþΪÕý¹æÎļþÎªÕæ
-d file¡¡¡¡¡¡¡¡¡¡ÎļþÎªÄ¿Â¼ÎªÕæ
-c file¡¡¡¡¡¡¡¡¡¡ÎļþΪ×Ö·ûÌØÊâÎļþÎªÕæ
-b file¡¡¡¡¡¡¡¡¡¡ÎļþΪ¿éÌØÊâÎļþÎªÕæ
-s file¡¡¡¡¡¡¡¡¡¡Îļþ´óС·Ç0Ê±ÎªÕæ
-t file¡¡¡¡¡¡¡¡¡¡µ±ÎļþÃèÊö·û(ĬÈÏΪ1)Ö¸¶¨µÄÉ豸ΪÖÕ¶ËÊ±ÎªÕæ
3 ¸´ÔÓÂß¼ÅжÏ
-a ¡¡ ¡¡¡¡¡¡¡¡¡¡ Óë
-o¡¡¡¡¡¡¡¡¡¡¡¡¡¡ »ò
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·Ç
ÓÐʱ¿´½Å±¾µÄʱºò²»ÖªµÀ¾ßÌåµÄÅжÏÊÇʲô£¬¿ÉÒԲο¼Ò»Ï¡£
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæÍ¼±ê
Ŀǰ½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËÆµÄ·½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
ÀûÓÃ
ÏÂÔØµÄÕâ¶Î´úÂ룬³É¹¦ÊµÏÖÁËÊØ»¤½ø³Ì£¬ÔÀ´ÊØ»¤½ø³ÌÊǺܼòµ¥µÄÊÂÇé¡£
¡¡¡¡ÔÚmainº¯ÊýÖÐÖ´ÐÐ
¡¡¡¡init_daemon();//³õʼ»¯ÎªDaemon
¡¡¡¡¾Í¿ÉÒ԰ѽø³Ì±ä³ÉÊØ»¤½ø³Ì
¡¡¡¡
#include
#include
#include
#include
#include
void
init_daemon(void
)
{
int
pid;
int
i;
if
(pid=fork()) ......
ת×Ô£ºhttp://lkml.org/lkml/2005/8/2/242
--------------------------------------------------------------------------------------------
from
Jesper Juhl <>
Subject
Documentation - how to apply patches for various trees
Date
Tue, 2 Aug 2005 23:32:20 +0200
Hi,
How to apply the -rc, -git, ......
Programming your application or library based on Qt has always had the promise that you can deploy your application on many different platforms. Development of those applications can, likewise, happen on many different platforms. QtCreator runs on Windows, Mac & Linux among others.
QtºÜ¼òµ¥£¬Ò× ......
svn·þÎñÆ÷²¿ÊðÔÚLinux²Ù×÷ϵͳÉÏ(IP:192.168.2.6)£¬ÎÒ½«±¸·ÝÎļþ±¸·Ýµ½±¾µØdÅÌ£¨windows£©²Ù×÷ϵͳ(IP:192.168.3.86)¡£
·þÎñÆ÷ÉϵŤ³ÌÏîÄ¿´æ·ÅÔÚCYMSĿ¼Ï£¬¼Æ»®±¸·Ýµ½±¾»úµÄd:\beifen\CYMSÎļþ¼ÐÏ¡£
1¡¢ÔËÐÐ-->cmd,½øÈëÃüÁîÌáʾ·û¡£
2¡¢ÔÚ·¾¶£ºd:\beifenÏÂʹÓÃÃüÁsvnadmin create C ......