LinuxϱàÒëºÍ²¿ÊðJavaWeb³ÌÐò½Å±¾
Ŀ¼½á¹¹ÈçÏ£º
|
|---- YourProject
| |-------- WebRoot
| | |---- WEB-INF
| | | |------- lib
| | | |------- classes
| |-------- src
|---- lib
|---- compile.sh
|---- deploy.sh
compile.sh
-------------------------------
#! /bin/bash
# check args
if [ $# -ne 1 ]
then echo "Usage:$0 PROJECT_NAME" exit
fi
PROJ=$1
# init path
CURRPATH=`pwd`
LIBDIR="$CURRPATH/$PROJ/WebRoot/WEB-INF/lib"
LIBDIR_OTHER="$CURRPATH/lib"
SOURCEDIR="$CURRPATH/$PROJ/src"
DISTDIR="$CURRPATH/$PROJ/WebRoot/WEB-INF/classes"
# classpath
CLASSPATH="$CLASSPATH"
TMP=`find $LIBDIR -name "*.jar" | awk '{var=$0":"var;}END{print var;}'`
CLASSPATH="$TMP$CLASSPATH"
TMP=`find $LIBDIR_OTHER -name "*.jar" | awk '{var=$0":"var;}END{print
var;}'`
CLASSPATH="$TMP$CLASSPATH"
# cleanup
rm -fr $DISTDIR/*
# javac
# CMD="javac -sourcepath $SOURCEDIR -classpath $CLASSPATH -d $DISTDIR
`find $SOURCEDIR -name "*.java"`"
# echo "cmd="$CMD
javac -sourcepath $SOURCEDIR -classpath $CLASSPATH -d $DISTDIR `find
$SOURCEDIR -name "*.java"`
# copy resources
# mkdir
cd $SOURCEDIR
echo "#! /bin/bash" > $CURRP
Ïà¹ØÎĵµ£º
ÎÒÃÇÖªµÀ£¬´ÓCMOSÖжÁ³öÀ´µÄϵͳʱ¼ä²¢²»ÊÇtime_tÀàÐÍ£¬¶øÊÇÀàËÆÓÚstruct tmÄÇÑù£¬ÄêÔÂÈÕʱ·ÖÃëÊÇ·Ö¿ª´æ´¢µÄ¡£
ÄÇô£¬Òª°ÑËüת»¯ÎªÏµÍ³±ãÓÚ´¦ÀíµÄtime_tÀàÐÍ£¬¾ÍÐèÒªËã·¨½øÐÐת»»¡£
ÎÒÃǶ¼ÖªµÀÎÒÃǵĹ«Àú»¹ÊDZȽϸ´Ôӵģ¬ÓдóÔÂСÔ£¬ÓÐÈòÄê·ÇÈòÄ꣬´¦ÀíÆðÀ´»áºÜÂé·³¡£
&n ......
ѧϰӦ¸ÃÊÇÒ»¸öÏÈ°ÑÎÊÌâ¼òµ¥»¯£¬ÔÚ°ÑÎÊÌ⸴ÔÓ»¯µÄ¹ý³Ì¡£Ò»¿ªÊ¼¾Í×ÅÊÖ´¦Àí¸´ÔÓµÄÎÊÌ⣬ÄÑÃâÈà ÈËÓÐÐľªµ¨²ü£¬×½½ó¼ûÖâµÄ¸Ð¾õ¡£¶ÁLinuxÍø¿¨Çý¶¯Ò²ÊÇÒ»Ñù¡£Ädz¤³¤µÄÔ´Âë¼ÐÔÓ×ÅÄÇЩÎÒÃÇÄ°ÉúµÄ±äÁ¿ºÍ·ûºÅ£¬Íû¶øÉúη±ãÊÇÀíËùµ±È»µÄÁË¡£²»Òªµ£ÐÄ£¬ÊÂÇé ×ÜÓнâ¾öµÄ°ì·¨£¬ÏÈ°ÑһЩÎÒÃǹܲ»×ŵĴúÂëÇиî³öÈ¥£¬ÁôϱØÐëµÄ²¿·Ö£¬°Ñ¿ò¼ÜÕ ......
½ñÌìÖÕÓÚ°ÑOmapL137µÄ°å×ÓÅÜÆðÁËLinuxºÍÆä´øµÄdemo¡£ºÏÖÚ´ï¶ÔÕâ¸ö°å×Ó¶«Î÷×öµÄºÜÉÙ£¬°Ñomapl137µÄÌص㶼ûÓÐչʾ³öÀ´¡£¿É¾Í¿àÁËÎÒÃÇÕâЩÏëÒªÓÃÕâ¸öƬ×ÓµÄÈËÁË¡£¹úÄÚÍæÕâ¸öµÄÈË»¹²»¶à£¬ËùÓÐ×ÊÁϾÍÓ²×ÅͷƤÂýÂýÄ¥°É¡£
Ç°¶Îʱ¼äubootÊÇÓÉdspÄDZßÓÃnandwrite¹¤³Ìд½øÀ´µÄ£¬ÆäУÑ鷽ʽºÍubootµÄeccУÑéËƺõÓгåÍ»£¬ ......
½ñÌ쿽±´ÁËÐéÄâ»úÔÚÁíÍâһ̨µçÄÔÉÏʹÓ㬷¢ÏÖMACµØÖ·³åÍ»£¬ÓÚÊÇÈ¥ÍøÉÏÕÒÐ޸ķ½·¨¡£¿É°´ÕÕËù˵µÄ£¬ÎÒ²¢Ã»ÓкÜ˳ÀûÐ޸ijɹ¦¡£
ÏÂÃæÎÒ½«¹ý³Ìд³öÀ´£¬ÀïÃæÓÐЩµØ·½ÐèҪעÒâһϡ£
ÏÂÃæÊÇÎÒ´ÓÍøÉÏËÑË÷µ½´ó²¿·ÖµÄ×ö·¨ÈçÏ£¬ºìÉ«²¿·ÖÊÇÎÒ×¢Ê͵ģ¬ÐèҪעÒâµÄµØ·½£º
VMwareÐéÄâ»úÖÐÐÞ¸ÄLinux MACµØÖ·µÄ·½·¨£º
1¡¢ÐÞ¸ÄÐéÄâ»úµÄ*.v ......
linux²Ù×÷ϵͳÏÂsystem () º¯ÊýÏê½â
¡¡¡¡£¨Ö´ÐÐshell ÃüÁ
¡¡¡¡Ïà¹Øº¯Êý
¡¡¡¡fork£¬execve£¬waitpid£¬popen
¡¡¡¡±íÍ·Îļþ
¡¡¡¡££include<stdlib.h>
¡¡¡¡¶¨Ò庯Êý
¡¡¡¡int system(const char * string);
¡¡¡¡º¯Êý˵Ã÷
¡¡¡¡system()»áµ÷ÓÃfork()²úÉú×Ó½ø³Ì£¬ÓÉ×Ó½ø³ÌÀ´µ÷ÓÃ/bin/sh-c stringÀ´Ö´ÐвÎÊýstring ......