zoukankan      html  css  js  c++  java
  • bourne again shell内建命令

    内建命令(build-in commands)是shell build-in的命令,当内建命令使用的时候,shell将会直接执行,无需新建子进程。内建命令被用来创建一些功能性的或者便捷性的组建。

    bash支持3中类型的内建命令

    • Bourne Shell build-ins
    • :
      ,
      .
      break
      cd
      continue
      eval
      exec
      exit
      export
      getopts
      hash
      pwd
      readonly
      return
      set
      shift
      test
      [
      times
      trap
      umask
      unset
    • Bash build-in commands
    • alias
      bind
      builtin
      command
      declare
      echo
      enable
      help
      let
      local
      logout
      printf
      read
      shopt
      type
      typeset
      ulimit
      unalias.
    • 特殊内建命令Special build-ins

    当运行再POSIX模式下时,主要的不同有以下3方面

    1. 特殊内建命令优先被找到(不知道这句理解得对不对原文:Special build-ins are found before shell functions during commands lookup)
    2. 如果一个内建命令返回了错误码,那么如果shell又是非交互(non_interactive)的,那么shell就会退出了。
    3. 命令执行完成之后,复制语句造成的副作用将会依旧存在。(稳妥起见原文奉上:Assignment statements preciding the command stay in effect in the shell environment after the commands complete)

    从shell启动程序的执行

    当程序通过shell启动,bash将会fork出一个subshell,subshell将会立即读取父shell的命令,命令读取后就会执行直到执行完毕或者被键盘送来的中断所打断。然后subshell将会执行所有命令而父shell则会等待其完成。当subshell执行完毕并终结,父shell将会被唤醒并重新打印语句在终端。

  • 相关阅读:
    python基本数据类型(—)
    linux基本命令
    1、认识Mysql
    Flask-SQLAlchemy详解
    sqlalchemy基本增删改查
    pymongo方法详解
    uWSGI+Nginx部署
    uwsgi
    nginx负载均衡配置
    redis-sentinel主从复制高可用(哨兵)
  • 原文地址:https://www.cnblogs.com/sunyuw/p/4222169.html
Copyright © 2011-2022 走看看