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

ѧϰlinux programming(1)


¡¾1. linux applications ÓÐÁ½ÖÖÐÎʽ¡¿
  i£©¿ÉÖ´ÐеÄÎļþ£º ¿ÉÓɼÆËã»úÖ±½ÓÔËÐУ¬Ï൱ÓÚwindowsµÄ.exeÎļþ
  ii£©Script: collections of instructions for another program. Ï൱ÓÚwindowsµÄ.bat .cmdÎļþ
 
¡¾2. PATH¡¿
ÔÚLinuxÖУ¬µ±ÊäÈë³ÌÐòÃû£¨ÈçFirefox£©Ê±£¬ÏµÍ³»áÔÚÃûΪPATHµÄShell±äÁ¿Ëù¸ø¶¨µÄһϵÁÐĿ¼ÖÐÑ°ÕÒÊÇ·ñÓÐͬÃûµÄÎļþ¡£
  ²é¿´PATHµÄÖµ£¬ÔÚLinux£º $PATH »òÕß echo $PATH
                windows£º PATH
Linux¿ÉÖ´ÐÐÎļþλÖÃ˵Ã÷£º
/bin: binaries, programs used in booting the system
/usr/bin: user binaries, standard programs available to users
/usr/local/bin:  local binaries, programs specific to an installation
µ±ÒÔadministatorÉí·Ý½øÈëʱ£¬¿ÉÄÜ»áʹÓÃϵͳ¹ÜÀí³ÌÐòËùÔÚµÄPATHĿ¼£¬Èç: /sbin »ò /usr/sbin
Linux£¬like unix, ÔÚPATH±äÁ¿µÄentriesÖ®¼äÓÃcolon(:)·Ö¸ô£¬¶øwindowsºÍms-dosÓÃsemicolon (;) ·Ö¸ô¡£
Linux£ºÊ¹ÓÃforward slash (/) À´·Ö¸ôĿ¼
eg: /usr/bin/
windows: ʹÓÃbackward slash (\)À´·Ö¸ô
eg: c:\Documents and settings\user>
 
¡¾3. C compiler¡¿
ÔÚPOSIX-compliant system  (POSIX: Portable Operating System Interface), C compiler is called c89.
in linux, c89, cc, gcc refer to the system c compiler.
 
¡¾4. first c program in linux¡¿
 1) hello.c file content
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello World!\n");
}  
 
 2) compile
  $gcc -o hello hello.c
 gcc²ÎÊý˵Ã÷£º
  -o <file>£ºÊä³öµ½file,Èôδָ¶¨-o£¬ÔòdefaultÊä³öµ½a.out
 Èç¹ûÒª²é¿´ÖмäÉú³ÉÎļþ£¬¿ÉÓÃgcc²ÎÊý  -save-temps
  $gcc -save-temps -o hello hello.c
  $ls
  hello hello.c hello.i hello.o hello.s
  //ÒÔÉÏÉú³ÉµÄ4¸öÎļþ˵Ã÷¼û¡¾5.±àÒëϵͳ¡¿
 3) execute
  $./hello
 ËµÃ÷£º
 ÈôÖ±½ÓÓÃhello£¬¼´Ö´ÐÐ
 $hello
 Ôòϵͳ»áÔÚShell±äÁ¿PATHËùÁгöµÄĿ¼ÖÐsearch£¬ÈôÇ¡ºÃÓÐÒ»¸öÃûΪ
helloµÄÎļþ£¬ÔòÖ´ÐÐÖ®¡£
 ./£º ´ú±íµ±Ç°Ä¿Â¼¡£
 
¡¾5.±àÒëϵÍ


Ïà¹ØÎĵµ£º

ÓÃLinuxÏÂPerl½Å±¾Á¬½ÓSQLServer

×¼±¸¹¤×÷:
¡¡¡¡Óõ½µÄperl À©Õ¹×é¼þ(modules)ÔÚÉÏƪÌù³ö.( win32::odbc Ä£¿é
)ÏÂÔØ×é¼þºó°´ÕÕReadmeÎļþ°²×°µ¹ÏìӦĿ¼.ÅäÖúÃÏàÓ¦µÄodbcÊý¾ÝÔ´.
¡¡¡¡
¡¡¡¡³ÌÐòʵÏÖ:
¡¡¡¡Ê¹ÓÃ
¡¡¡¡use
Win32::ODBC;
¡¡¡¡
¡¡¡¡Óï¾ä°üº¬Ó¦Ê¹ÓõÄÄ£¿éÊÇwin32::odbc,д³öÊý¾Ý¿â
Á¬½Ó×Ö·û´®
¡¡¡¡
¡¡¡¡$DSN = "DSN =
My DSN ......

LinuxÖÐfindÃüÁî

 
ÔÚWindowsÖпÉÒÔÔÚijЩ·¾¶ÖвéÕÒÎļþ£¬Ò²¿ÉÒÔÉ趨²»ÔÚijЩ·¾¶ÖвéÕÒÎļþ£¬ÏÂÃæÓÃLinuxÖеÄfindµÄÃüÁî½áºÏÆä-path -prune²ÎÊýÀ´¿´¿´ÔÚLinuxÖÐÔõôʵÏִ˹¦ÄÜ¡£
¼ÙÈçÔÚµ±Ç°Ä¿Â¼Ï²éÕÒÎļþ£¬ÇÒµ±Ç°Ä¿Â¼ÏÂÓкܶàÎļþ¼°Ä¿Â¼£¨¶à²ãĿ¼£©£¬°üÀ¨dir0¡¢dir1ºÍdir2 ...µÈĿ¼¼°dir00¡¢dir01...dir10¡¢dir11...µÈ×ÓĿ¼¡£ ......

ÔÚLinuxÏ°²×° Sybase ASE 11.0.3.3

£¨ÉùÃ÷£ºÕâÊÇתÔØ×Ôhttp://www.chinaunix.net/jh/21/1079.html)
´ÓSybaseµÄÕ¾µãÉÏÏÂÔØÁ½¸öÈí¼þ°ü£¬±ÊÕßÏÂÔØÁË11.0.3.3°æ±¾£¬SybaseÄ¿Ç°ÒѾ­ÍƳöÁËASE11.9.2£¬ÓÉ
ÓÚ11.9.2Èí¼þ°üºÜ´ó£¬ÓÉ6¸örpmÈí¼þ°ü×é³É£¬¸÷λ¿ÉÒÔÈ¥ÆäÕ¾µãÏÂÔØ¡£¶ÔÓÚSybase¡¡11.0.3£¬sybaseÌṩÁË
Á½¸örpm¸ñʽµÄÈí¼þ°ü¡£ 
£¨ÕâÁ½¸öÎļþ¿ÉÒÔ¿´ÎÒ²©¿ ......

Linux RPM ÃüÁî²ÎÊýʹÓÃÏê½â£Û½éÉܺÍÓ¦ÓãÝ


RPMÊÇRedHat Package Manager£¨RedHatÈí¼þ°ü¹ÜÀí¹¤¾ß£©ÀàËÆWindowsÀïÃæµÄ¡°Ìí¼Ó/ɾ³ý³ÌÐò¡±
 
rpm Ö´Ðа²×°°ü
¶þ½øÖÆ°ü£¨Binary£©ÒÔ¼°Ô´´úÂë°ü£¨Source£©Á½ÖÖ¡£¶þ½øÖÆ°ü¿ÉÒÔÖ±½Ó°²×°ÔÚ¼ÆËã»úÖУ¬¶øÔ´´úÂë°ü½«»áÓÉRPM×Ô¶¯±àÒë¡¢°²×°¡£Ô´´úÂë°ü¾­³£ÒÔsrc.rpm×÷Ϊºó׺Ãû¡£
 
³£ÓÃÃüÁî×éºÏ£º
 
£­ivh£º ......

Socket±à³Ì£ºÓÉLinuxÏòWindowsÒÆÖ²ÎÊÌâ


ת×Ô£ºhttp://www.cic.tsinghua.edu.cn/jdx/book1/CHAPTER3.htm
 
ÔÚÔ´Îļþ¿ªÊ¼Ôö¼Ó#include <winsock.h>Óï¾ä¡£
µ÷ÓÃWSAStartup()º¯Êý³õʼ»¯Windows Sockets DLL£¬²¢ÔÚ½áÊøʱµ÷ÓÃWSACleanup()º¯Êý֪ͨWindows Sockets DLLÊÍ·Å×ÊÔ´¡£
½«Ì×½Ó×ÖµÄÀàÐÍΪint¸ÄΪSOCKET¡£
»ñÈ¡¡¢ÉèÖôíÎóÂ벻ҪʹÓÃÈ«¾Ö±äÁ¿er ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ