亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? _chapter 8.htm

?? linux、unix初學者的必讀書籍 詳細講述了shell編程方法與技巧
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Chapter 8</title>
<link rel="stylesheet" type="text/css" href="docsafari.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body><table width="100%" border="1" bgcolor="#EBEBFF"><tr><td width="5%" align="left" valign="middle"><a href="_chapter 7.htm"><img src="Larrow.gif" width="17" height="19" border="0"></a></td><td align="center" valign="middle"><a class="docLink" href="Front matter.htm">CONTENTS</a></td><td width="5%" align="right" valign="middle"><a href="_chapter 9.htm"><img src="Rarrow.gif" width="17" height="19" border="0"></a></td></tr></table>

<h2 class="docChapterTitle">Chapter 8. The Interactive Bourne Shell</h2><ul><li>&nbsp;<a class="docLink" href="#ch08lev1sec1">8.1 Startup</a></li>
<li>&nbsp;<a class="docLink" href="#ch08lev1sec2">8.2 Programming with the Bourne Shell</a></li>
<li>&nbsp;<a class="docLink" href="#ch08lev1sec3">BOURNE SHELL LAB EXERCISES</a></li>
</ul>

<p class="docText">
<img alt="graphics/ch08.gif" src="ch08.gif" border="0" width="500" height="1152"></p>
<h3 class="docSection1Title" id="ch08lev1sec1">8.1 Startup</h3>
<p class="docText">If the Bourne shell is your login shell, it follows a chain 
of processes before you see a shell prompt.</p>
<center>
<h5 id="ch08fig01" class="docFigureTitle">Figure 8.1. Starting the Bourne shell.</h5>
<p class="docText">
<img alt="graphics/08fig01.gif" src="08fig01.gif" border="0" width="375" height="452"></p>
</center>
<p class="docText">The first process to run is called <span class="docEmphasis">
init,</span> PID 1. It gets instructions from a file called
<span class="docEmphasis">inittab</span> (System V), or it spawns a
<span class="docEmphasis">getty</span> process (BSD). These processes open up 
the terminal ports, providing a place where standard input comes from and a 
place where standard output and error go, and they put a login prompt on your 
screen. The <span class="docEmphasis">/bin/login</span> program is then 
executed. The <span class="docEmphasis">login</span> program prompts for a 
password, encrypts and verifies the password, sets up an initial environment, 
and starts up the login shell, <span class="docEmphasis">/bin/sh,</span> the 
last entry in the <span class="docEmphasis">passwd</span> file. The
<span class="docEmphasis">sh</span> process looks for the system file,
<span class="docEmphasis">/etc/profile,</span> and executes its commands. It 
then looks in the user's home directory for an initialization file called
<span class="docEmphasis">.profile.</span> After executing commands from
<span class="docEmphasis">.profile,</span> the default dollar sign ($) prompt 
appears on your screen and the Bourne shell awaits commands.</p>
<h4 class="docSection2Title" id="ch08lev2sec1">8.1.1 The Environment</h4>
<p class="docText">The environment of a process consists of variables, open 
files, the current working directory, functions, resource limits, signals, and 
so forth. It defines those features that are inherited from one shell to the 
next and the configuration for the working environment. The configuration for 
the user's shell is defined in the shell initialization files.</p>
<p class="docText"><b>The Initialization Files.</b> After the Bourne shell 
program starts up, it first checks for the system file <span class="docEmphasis">
/etc/profile.</span> After executing the commands in that file, the 
initialization file, <span class="docEmphasis">.profile,</span> in the user's 
home directory, is executed. Skeleton files for initial setup can be found in
<span class="docEmphasis">/etc/skel</span> (SVR4).</p>
<p class="docText"><span class="docEmphStrong">The <span class="docEmphasis">
/etc/profile</span> File.</span> The <span class="docEmphasis">/etc/profile</span> 
file is a systemwide initialization file set up by the system administrator to 
perform tasks when the user logs on. It is executed when the Bourne shell starts 
up. It is available to all Bourne and Korn shell users on the system and 
normally performs such tasks as checking the mail spooler for new mail and 
displaying the message of the day from the <span class="docEmphasis">/etc/motd</span> 
file. (The following examples will make more sense after you have completed this 
chapter.)</p>
<h5 id="ch08list01" class="docExampleTitle">Example 8.1 </h5>
<pre>(Sample <span class="docEmphasis">/etc/profile</span>)
# <span class="docEmphasis">The profile that all logins get before using their own .profile</span>
1   trap &quot; &quot; 2 3
2   export LOGNAME PATH
3   if [ &quot;$TERM&quot; = &quot; &quot; ]
    then
        if /bin/i386
        then
             TERM=AT386   <span class="docEmphasis"># Sets the terminal</span>
        else
             TERM=sun
        fi
        export TERM
    fi
    # <span class="docEmphasis">Login and -su shells get /etc/profile services.</span>
    # <span class="docEmphasis">-rsh is given its environment in its own .profile.</span>
4      case &quot;$0&quot; in
       -sh | -ksh | -jsh )
5          if [ ! -f .hushlogin ]
           then
              /usr/sbin/quota
              # <span class="docEmphasis">Allow the user to break the Message-Of-The-</span>
              # <span class="docEmphasis">Day only.</span>
6             trap &quot;trap ' ' 2&quot; 2
7             /bin/cat -s /etc/motd	
              <span class="docEmphasis"># Message of the day displayed</span>
              trap &quot; &quot; 2
8             /bin/mail -E      <span class="docEmphasis"># Checks for new mail</span>
9             case $? in
              0)
                   echo &quot;You have new mail. &quot;
              ;  ;
              2)
                   echo &quot;You have mail. &quot;
                   ;;
              esac
           fi
       esac
10     umask 022
11     trap 2 3
</pre>
<table cellSpacing="0" width="90%" border="1" align="center">
  <tr>
    <td>
    <h2 class="docSidebarTitle">EXPLANATION</h2>
    <span style="FONT-WEIGHT: bold">
    <ol class="docList" type="1">
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The <span class="docEmphasis">trap</span> command 
      controls signals coming into this program while it is running. If signals
      <span class="docEmphasis">2</span> (Control-C) or
      <span class="docEmphasis">3</span> (Control-\) are sent while the program 
      is in execution, those signals will be ignored.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The variables <span class="docEmphasis">LOGNAME</span> 
      and <span class="docEmphasis">PATH</span> are exported so that their 
      values will be known in subshells started from this process.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The command <span class="docEmphasis">/bin/i386</span> 
      is executed. If the exit status of the command is zero, the terminal 
      variable, <span class="docEmphasis">TERM,</span> is assigned the value
      <span class="docEmphasis">AT386;</span> if not, the
      <span class="docEmphasis">TERM</span> variable is assigned
      <span class="docEmphasis">sun.</span></span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">If the value of <span class="docEmphasis">$0,</span> 
      the name of the program running the <span class="docEmphasis">/etc/profile</span> 
      file, is either a login or Bourne, Korn, or job shell, the following 
      commands will be executed.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">If the <span class="docEmphasis">.hushlogin</span> file 
      does not exist, <span class="docEmphasis">quota</span> will be run to 
      display the disk usage warnings if usage is over the quota.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The <span class="docEmphasis">trap</span> is reset so 
      that the user can terminate the message of the day with Control-C.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">After the message of the day has been displayed, the
      <span class="docEmphasis">trap</span> is reset to ignore Control-C.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The <span class="docEmphasis">mail</span> program 
      checks for new incoming mail.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">If the exit status (<span class="docEmphasis">$?</span>) 
      of the <span class="docEmphasis">mail</span> program is
      <span class="docEmphasis">0</span> or <span class="docEmphasis">2,</span> 
      the message &quot;<span class="docEmphasis">You have new mail.</span>&quot; or &quot;<span class="docEmphasis">You 
      have mail.</span>&quot;, respectively, is displayed.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The <span class="docEmphasis">umask</span> command is 
      set to determine the initial permissions of files and directories when 
      they are created.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The <span class="docEmphasis">trap</span> command sets 
      signals <span class="docEmphasis">2</span> and <span class="docEmphasis">3</span> 
      back to their defaults; i.e., to kill the program if either Control-C or 
      Control-\ arrive.</span></li>
    </ol>
    </span></td>
  </tr>
</table>
<p class="docText"><span class="docEmphStrong">The <span class="docEmphasis">
.profile</span> File.</span> The <span class="docEmphasis">.profile</span> file 
is a user-defined initialization file executed once at login and found in your 
home directory. It gives you the ability to customize and modify the shell 
environment. Environment and terminal settings are normally put here, and if a 
window application or database application is to be initiated, it is started 
here. The settings in this file will be discussed in detail as the chapter 
progresses, but a brief synopsis of each line in the file is explained here.</p>
<h5 id="ch08list02" class="docExampleTitle">Example 8.2 </h5>
<pre>(Sample .<span class="docEmphasis">profile</span>)

1   TERM=vt102
2   HOSTNAME='uname -n'
3   EDITOR=/usr/ucb/vi
4   PATH=/bin:/usr/ucb:/usr/bin:/usr/local:/etc:/bin:/usr/bin:
5   PS1=&quot;$HOSTNAME $ &gt; &quot;
6   export TERM HOSTNAME EDITOR PATH PS1
7   stty erase ^h
8   go () { cd $1; PS1='pwd'; PS1='basename $PS1'; }
9   trap '$HOME/.logout' EXIT
10  clear
</pre>
<table cellSpacing="0" width="90%" border="1" align="center">
  <tr>
    <td>
    <h2 class="docSidebarTitle">EXPLANATION</h2>
    <span style="FONT-WEIGHT: bold">
    <ol class="docList" type="1">
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The <span class="docEmphasis">TERM</span> variable is 
      assigned the value of the terminal type, <span class="docEmphasis">vt102.</span></span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">Because the <span class="docEmphasis">uname 杗</span> 
      command is enclosed in backquotes, the shell will perform command 
      substitution, i.e., the output of the command (the name of the host 
      machine) will be assigned to the variable <span class="docEmphasis">
      HOSTNAME.</span></span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The <span class="docEmphasis">EDITOR</span> variable is 
      assigned <span class="docEmphasis">/usr/ucb/vi.</span> Programs such as
      <span class="docEmphasis">mail</span> will now have this variable 
      available when defining an editor.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The <span class="docEmphasis">PATH</span> variable is 
      assigned the directory entries that the shell searches in order to find a 
      UNIX program. If, for example, you type <span class="docEmphasis">ls,</span> 
      the shell will search the <span class="docEmphasis">PATH</span> until it 
      finds that program in one of the listed directories. If it never finds the 
      program, the shell will tell you so.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">The primary prompt is assigned the value of
      <span class="docEmphasis">HOSTNAME,</span> the machine name, and the
      <span class="docEmphasis">$</span> and <span class="docEmphasis">&gt;</span> 
      symbols.</span></li>
      <li><span style="FONT-WEIGHT: normal">
      <p class="docList">All of the variables listed are exported. They will be 
      known by child processes started from this shell.</span></li>
      <li><span style="FONT-WEIGHT: normal">

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品videosex极品| 国产精品亚洲午夜一区二区三区 | 极品美女销魂一区二区三区| 加勒比av一区二区| 成人成人成人在线视频| 欧美性色黄大片手机版| www日韩大片| 亚洲理论在线观看| 韩国一区二区三区| 日本高清不卡一区| 久久久不卡网国产精品二区| 亚洲另类色综合网站| 国内外成人在线视频| 色综合久久99| 2024国产精品视频| 亚洲自拍另类综合| 国产福利不卡视频| 欧美精品乱码久久久久久按摩| 欧美激情一区在线| 日本不卡中文字幕| 91片在线免费观看| 精品免费视频.| 亚洲高清不卡在线| 成人动漫在线一区| 日韩美女视频在线| 亚洲精品国产无套在线观| 狠狠狠色丁香婷婷综合激情| 欧美三级视频在线| 综合亚洲深深色噜噜狠狠网站| 国产午夜一区二区三区| 亚洲免费在线视频| 欧美亚洲国产一卡| 欧美激情一区二区在线| 免费黄网站欧美| 国产视频一区在线播放| 亚洲综合区在线| 国产成人鲁色资源国产91色综 | 免费在线一区观看| 日韩精品专区在线| 一区二区成人在线| 福利视频网站一区二区三区| 欧美精品一卡两卡| 欧美高清在线视频| 激情六月婷婷综合| 欧美精品久久久久久久多人混战 | 黑人巨大精品欧美一区| 8x福利精品第一导航| 一区二区三区四区国产精品| 成人sese在线| 亚洲国产经典视频| 国产一区二区精品久久91| 日韩一区二区中文字幕| 亚洲午夜电影在线观看| 色爱区综合激月婷婷| 国产精品久久久久国产精品日日| 国产一区二区精品久久91| 精品三级在线观看| 美腿丝袜亚洲三区| 欧美一区二区二区| 日本免费在线视频不卡一不卡二| 欧美日韩综合色| 亚洲福利一区二区三区| 欧美视频精品在线| 亚洲一区在线观看免费观看电影高清| 91亚洲大成网污www| 国产精品高潮呻吟| 99精品欧美一区二区三区小说| 国产精品免费看片| 不卡的av中国片| 日韩一区在线免费观看| 91麻豆免费看| 亚洲精品第一国产综合野| 色偷偷久久人人79超碰人人澡| 亚洲九九爱视频| 欧美性猛交xxxxxxxx| 亚洲成人免费在线观看| 在线成人av影院| 美女高潮久久久| 精品免费国产一区二区三区四区| 捆绑变态av一区二区三区| 精品处破学生在线二十三| 国产精品一区二区在线观看不卡| 久久精品无码一区二区三区| 福利一区二区在线观看| 亚洲欧美另类图片小说| 26uuu色噜噜精品一区二区| 波多野结衣91| 成人aa视频在线观看| 国产盗摄精品一区二区三区在线| 亚洲人成影院在线观看| 久久综合给合久久狠狠狠97色69| 91一区二区在线| 国产精品香蕉一区二区三区| 天堂一区二区在线免费观看| 亚洲欧洲一区二区在线播放| 久久综合中文字幕| 制服丝袜亚洲色图| 国产成人精品免费网站| 国产精品麻豆一区二区| 91麻豆swag| 视频一区二区国产| 久久久久综合网| 一本大道综合伊人精品热热| 亚洲午夜成aⅴ人片| 日韩欧美成人一区二区| 国产高清不卡二三区| 亚洲欧洲精品一区二区三区| 色综合久久中文综合久久牛| 日韩国产欧美在线视频| 久久久午夜电影| 色狠狠综合天天综合综合| 青青草国产成人99久久| 中文字幕欧美区| 欧美老女人第四色| 国产精品一二三| 亚洲成人av资源| 国产人伦精品一区二区| 欧美日韩一区 二区 三区 久久精品| 美腿丝袜一区二区三区| 亚洲欧洲在线观看av| 制服.丝袜.亚洲.另类.中文| 成人黄色av网站在线| 欧美aaaaa成人免费观看视频| 国产欧美精品一区二区色综合 | 中文字幕一区二区三区四区不卡| 欧美日韩一区二区三区高清 | 国产精品另类一区| 欧美日韩不卡一区| 国产成人精品一区二| 天堂在线亚洲视频| 中文字幕一区二区三区在线播放| 日韩欧美色综合| 91精彩视频在线观看| 国产另类ts人妖一区二区| 亚洲福中文字幕伊人影院| 国产精品无人区| 日韩色视频在线观看| 在线欧美一区二区| 国产成人精品亚洲日本在线桃色| 石原莉奈在线亚洲二区| 久久精品欧美日韩| 91精品麻豆日日躁夜夜躁| 色综合久久久久久久久| 国产成人精品1024| 久久国产生活片100| 午夜在线成人av| 亚洲乱码中文字幕| 国产精品素人一区二区| 欧美大片国产精品| 欧美色视频在线观看| 99re在线视频这里只有精品| 国产一区二区三区在线看麻豆| 亚洲一级电影视频| 成人免费在线视频| 国产女主播一区| 欧美变态凌虐bdsm| 在线不卡的av| 欧美色偷偷大香| 日本福利一区二区| av资源网一区| 成人久久久精品乱码一区二区三区 | 国产一区二区不卡在线| 日本免费新一区视频| 亚洲激情图片小说视频| 亚洲欧美怡红院| 国产精品美女一区二区| 国产欧美精品一区二区色综合 | 高清不卡一区二区| 国产精品资源在线看| 久久国产剧场电影| 热久久免费视频| 午夜精品久久久| 日韩精品乱码av一区二区| 无吗不卡中文字幕| 污片在线观看一区二区| 亚洲国产日韩a在线播放| 亚洲第四色夜色| 日日摸夜夜添夜夜添精品视频| 日韩一区精品视频| 日韩影院在线观看| 欧美a级理论片| 狠狠色丁香久久婷婷综合_中| 久久国产精品免费| 精品一区二区三区的国产在线播放| 麻豆精品久久精品色综合| 青青草91视频| 激情图片小说一区| 国产福利视频一区二区三区| 风流少妇一区二区| 99精品国产一区二区三区不卡| 91热门视频在线观看| 欧美日韩综合在线免费观看| 欧美日韩高清一区二区不卡| 欧美精品777| 日韩情涩欧美日韩视频| 亚洲精品在线免费观看视频| 国产午夜精品久久| 中文字幕亚洲成人| 亚洲国产一区在线观看| 日韩激情视频在线观看|