シェルプログラミングの基礎!(oracle...)


Shell

http://wiki.ubuntu.org.cn/Shell%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80

 

, gedit、kedit、emacs、vi shell , ( ):

#!/bin/sh
...
:「!/bin/bash」ではなく、「!/bin/sh」を ったら、tc shellを ってtcshに えたら、 のようです. このスクリプトの をシステムに えるためのプログラムは、 では/bin/shを します. が し、 した 、このスクリプトを するには、まず にする があります.
chmod +x filename

はその 、スクリプトの ディレクトリの に してください./filenameはスクリプトを できます.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
UBUNTU 8.1      SH  
          。
    sudo su
      。      root     。
        (            ,           。)
  ./sh    
    。
えを
      sh   1.sh,        /tmp    ,     ,    :
$ sudo su
pass your password:(                   ,           。)
#cd /tmp
#./1.sh
   OK 。

SH   Linux             ,    sh               。    sh        。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

ubuntu shell :bash dash

  bash       shell  (               ), ubuntu , sh test.sh   ,            ,  echo -e "/nTest/n"      ,   sh test.sh  ,    -e(     );         echo -e "/nTest/n"     "-e" 。
         ,       Ubuntu sh    dash。
echo $SHELL  -->  /bin/bash
type sh      -->  /bin/sh
    /bin    "sh -> dash",  sh /bin/dash   。
  google      ,buntu6.10       bashshell    dash。    /bin/sh    /bin/dash      /bin/bash。
bash - GNU Bourne-Again SHell
dash - Debian Almquist Shell
    man bash  / man dash   。

     sh    bash ?
            /bin/sh      bash ,
 :ln -s /bin/bash /bin/sh
  ,        ,
sudo dpkg-reconfigure dash
         dash   , no    。
      , ls /bin/sh -al        /bin/bash    。 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

linux source

source : source FileName : bash FileName 。 : “.” 。 :source .bash_rc . .bash_rc 。 source ( C Shell ) bash shell 。 , ,( Bourne Shell ) source
, ,source( ) , .bash_profile .profile 。
, .bash_profile EDITER TERM , source .bash_profile 。 export $KKK=111 , ./a.sh , , echo $KKK , , source , echo , KKK=111。
./a.sh shell shell , , shell , source shell , source ( C Shell ) bash shell 。 , ,( Bourne Shell ) source 。 ,
shell , 。 Shell 。 , ,
source( ) , .bash_profile .profile 。 , .bash_profile EDITER TERM ,
source .bash_profile 。 .bash_profile Shell , source 。 source , , make mrproper make menuconfig make dep make clean make bzImage ....... , 。 , 。 , , , 。
source 。 shell 。 /usr/src/linux- 2.4.20 , make_command: : make mrproper && make menuconfig && make dep && make clean && make bzImage && make modules && make modules_install && cp arch/i386/boot/bzImge /boot/vmlinuz_new && cp System.map /boot && vi /etc/lilo.conf && lilo -v , , /usr/src/linux-2.4.20 source make_command 。 , 。 source 。 lilo , 。 。 shell C 。&& ,|| 。 && , make mrproper && make menuconfig , 。
, 。
http://hi.baidu.com/linuxcer/blog/item/8462d1990827fc0a6e068c14.html
----------------------------------------------- ---------------- ---------------------- ----------------------------------------------- 1 test.sh   #!/bin/bash   export s=/home/jboss/ 2   : source test.sh            echo $s   : /home/jboss/ 3  shell    :   ./test.sh             echo $s      :  s