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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? _chapter 8.htm

?? linux、unix初學(xué)者的必讀書籍 詳細講述了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">

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久久久久浪潮| 亚洲mv在线观看| 久久中文字幕电影| 日韩三级免费观看| 4438x亚洲最大成人网| 欧美色老头old∨ideo| 欧美影片第一页| 欧美日韩一区二区三区四区五区| 欧美无乱码久久久免费午夜一区| 欧美日韩综合在线| 欧美日韩免费观看一区三区| 3d成人动漫网站| 欧美一二三区在线| 精品对白一区国产伦| 久久久久久久久岛国免费| 国产亚洲视频系列| 成人欧美一区二区三区视频网页| 亚洲免费看黄网站| 亚洲国产成人tv| 美女性感视频久久| 国产一区二区三区观看| 国产不卡在线视频| 色香蕉成人二区免费| 欧美日韩夫妻久久| 精品国产精品网麻豆系列| 中文字幕不卡在线播放| 亚洲蜜臀av乱码久久精品 | 国产精品久久久久一区二区三区| 中文字幕亚洲在| 一区二区成人在线| 美女久久久精品| 国产91露脸合集magnet| 色婷婷亚洲精品| 91精品国产一区二区三区香蕉| 日韩免费高清av| 国产日韩欧美精品在线| 亚洲精品久久久蜜桃| 日本不卡一二三| 成人亚洲一区二区一| 欧美日韩一区二区在线观看视频 | 欧美成人vr18sexvr| 亚洲国产精品成人综合色在线婷婷| 亚洲男人天堂av网| 麻豆精品精品国产自在97香蕉| 国产馆精品极品| 欧美挠脚心视频网站| 国产午夜亚洲精品午夜鲁丝片| 一级日本不卡的影视| 韩国成人精品a∨在线观看| 91亚洲精华国产精华精华液| 欧美精品xxxxbbbb| 国产精品天美传媒| 日韩av不卡一区二区| 99视频超级精品| 精品国产一区二区三区久久久蜜月| 亚洲欧美色图小说| 久久激五月天综合精品| 欧美在线你懂的| 亚洲国产成人一区二区三区| 免费在线观看视频一区| 播五月开心婷婷综合| 欧美一区二区视频在线观看2020| 国产精品激情偷乱一区二区∴| 免费看日韩精品| 91香蕉视频污| 久久午夜老司机| 五月婷婷激情综合| 99re在线精品| 久久久久久影视| 免费成人性网站| 欧美日韩一区精品| 综合久久久久综合| 国产成人免费在线观看| 欧美一区二区三区不卡| 亚洲午夜久久久久久久久电影院| 国产成人精品免费看| 欧美一激情一区二区三区| 亚洲午夜在线观看视频在线| 99精品视频在线观看免费| 精品国产乱码久久久久久图片 | 国产欧美精品一区二区三区四区| 日日噜噜夜夜狠狠视频欧美人| 不卡一区二区中文字幕| 久久这里只有精品视频网| 日韩专区在线视频| 91美女片黄在线| 亚洲欧洲国产日韩| 国产精品一区二区男女羞羞无遮挡| 欧美精品vⅰdeose4hd| 亚洲自拍偷拍综合| 色av成人天堂桃色av| 国产精品久久久久久久久快鸭| 国产精品996| 久久美女高清视频| 国产又黄又大久久| 欧美精品一区视频| 国产一区二区0| 久久精品欧美一区二区三区不卡 | 欧美网站大全在线观看| 亚洲免费观看视频| 色婷婷综合久久久中文字幕| 亚洲欧美激情一区二区| 91麻豆福利精品推荐| 国产精品每日更新| 99精品久久只有精品| 国产精品久久毛片a| 不卡在线观看av| 日韩毛片在线免费观看| 不卡的电影网站| 亚洲啪啪综合av一区二区三区| 99精品视频在线观看| 一区二区三区加勒比av| 欧美午夜片在线看| 天天色天天操综合| 91精品国产福利在线观看| 精品一二三四在线| 国产三级精品在线| av网站一区二区三区| 亚洲精品老司机| 欧美片网站yy| 狠狠色狠狠色综合系列| 国产亚洲午夜高清国产拍精品| 成人av电影免费观看| 一区二区在线观看视频 | 国产精品久久一级| 色婷婷亚洲精品| 午夜精品久久久久久久久| 日韩欧美一级二级三级久久久| 国产精品一区二区无线| 亚洲欧洲国产日韩| 欧美精选一区二区| 久久精品国产久精国产| 欧美激情一区三区| 欧美综合在线视频| 久久成人久久爱| 中文字幕va一区二区三区| 日本韩国欧美一区二区三区| 日韩精品福利网| 国产亚洲精品7777| 日本久久精品电影| 精品一区精品二区高清| 国产精品久久久久久久久晋中 | 亚洲色图欧洲色图| 欧美挠脚心视频网站| 国产精品一区二区男女羞羞无遮挡 | 久久在线观看免费| 91在线精品一区二区| 日韩av在线免费观看不卡| 国产色婷婷亚洲99精品小说| 日本国产一区二区| 卡一卡二国产精品| 亚洲男人天堂一区| 精品国产露脸精彩对白| 色综合天天性综合| 久久国产剧场电影| 亚洲欧美自拍偷拍色图| 欧美一区二区三区成人| 99久久久无码国产精品| 人人狠狠综合久久亚洲| 自拍偷拍国产亚洲| 欧美大片在线观看| 在线视频欧美精品| 国产精品一区二区久久不卡| 亚洲国产精品久久久久秋霞影院| 国产网红主播福利一区二区| 欧美午夜精品一区二区蜜桃| 国产精品99久久久久久久女警| 午夜精品在线看| 国产精品电影一区二区| 日韩精品一区在线| 色播五月激情综合网| 国产精品123| 免费美女久久99| 亚洲午夜精品在线| 亚洲丝袜精品丝袜在线| 久久夜色精品国产噜噜av| 欧美日韩激情一区| 色中色一区二区| 国产91精品一区二区麻豆亚洲| 久久精品国内一区二区三区| 亚洲国产综合91精品麻豆| 日韩美女久久久| 国产精品午夜电影| 精品国产成人在线影院| 欧美精品1区2区| 在线精品国精品国产尤物884a| 成人免费av网站| 国产精品一线二线三线| 久久精品国产亚洲aⅴ| 日本成人超碰在线观看| 亚洲线精品一区二区三区| 亚洲男女毛片无遮挡| 一区二区在线观看av| 国产精品99久久久久久久vr| 麻豆精品一区二区综合av| 亚洲777理论| 一区二区三区日韩精品视频| 中文字幕一区免费在线观看| 久久精品一区八戒影视| www国产成人免费观看视频 深夜成人网|