首页 > 系统相关 >Linux - set

Linux - set

时间:2024-06-16 22:55:13浏览次数:8  
标签:shell parameters same positional set command Linux

 

zzh@ZZHPC:~$ help set
set: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
    Set or unset values of shell options and positional parameters.
    
    Change the value of shell attributes and positional parameters, or
    display the names and values of shell variables.
    
    Options:
      -a  Mark variables which are modified or created for export.
      -b  Notify of job termination immediately.
      -e  Exit immediately if a command exits with a non-zero status.
      -f  Disable file name generation (globbing).
      -h  Remember the location of commands as they are looked up.
      -k  All assignment arguments are placed in the environment for a
          command, not just those that precede the command name.
      -m  Job control is enabled.
      -n  Read commands but do not execute them.
      -o option-name
          Set the variable corresponding to option-name:
              allexport    same as -a
              braceexpand  same as -B
              emacs        use an emacs-style line editing interface
              errexit      same as -e
              errtrace     same as -E
              functrace    same as -T
              hashall      same as -h
              histexpand   same as -H
              history      enable command history
              ignoreeof    the shell will not exit upon reading EOF
              interactive-comments
                           allow comments to appear in interactive commands
              keyword      same as -k
              monitor      same as -m
              noclobber    same as -C
              noexec       same as -n
              noglob       same as -f
              nolog        currently accepted but ignored
              notify       same as -b
              nounset      same as -u
              onecmd       same as -t
              physical     same as -P
              pipefail     the return value of a pipeline is the status of
                           the last command to exit with a non-zero status,
                           or zero if no command exited with a non-zero status
              posix        change the behavior of bash where the default
                           operation differs from the Posix standard to
                           match the standard
              privileged   same as -p
              verbose      same as -v
              vi           use a vi-style line editing interface
              xtrace       same as -x
      -p  Turned on whenever the real and effective user ids do not match.
          Disables processing of the $ENV file and importing of shell
          functions.  Turning this option off causes the effective uid and
          gid to be set to the real uid and gid.
      -t  Exit after reading and executing one command.
      -u  Treat unset variables as an error when substituting.
      -v  Print shell input lines as they are read.
      -x  Print commands and their arguments as they are executed.
      -B  the shell will perform brace expansion
      -C  If set, disallow existing regular files to be overwritten
          by redirection of output.
      -E  If set, the ERR trap is inherited by shell functions.
      -H  Enable ! style history substitution.  This flag is on
          by default when the shell is interactive.
      -P  If set, do not resolve symbolic links when executing commands
          such as cd which change the current directory.
      -T  If set, the DEBUG and RETURN traps are inherited by shell functions.
      --  Assign any remaining arguments to the positional parameters.
          If there are no remaining arguments, the positional parameters
          are unset.
      -   Assign any remaining arguments to the positional parameters.
          The -x and -v options are turned off.
    
    Using + rather than - causes these flags to be turned off.  The
    flags can also be used upon invocation of the shell.  The current
    set of flags may be found in $-.  The remaining n ARGs are positional
    parameters and are assigned, in order, to $1, $2, .. $n.  If no
    ARGs are given, all shell variables are printed.
    
    Exit Status:
    Returns success unless an invalid option is given.

 

标签:shell,parameters,same,positional,set,command,Linux
From: https://www.cnblogs.com/zhangzhihui/p/18251434

相关文章

  • 4.12 Python set集合基本操作
    Pythonset集合基本操作(添加、删除、交集、并集、差集)Pythonset集合最常用的操作是向集合中添加、删除元素,以及集合之间做交集、并集、差集等运算,本节将一一讲解这些操作的具体实现。向set集合中添加元素set集合中添加元素,可以使用set类型提供的add()方法实现,该......
  • 嵌入式Linux中的LED驱动控制(使用多个次设备号)
    在前面的LED驱动控制中,都只使用了一个设备节点(一个次设备号)来进行操作,本例来讨论一下如何把三个基色的LED分别当成三个次设备,即产生出三个设备节点文件,但共用一个设备驱动(同一个主设备号),应用程序各自控制各自的LED。下面先给出完整的驱动程序代码,文件名仍为led.c。#include<l......
  • 【Linux】线程(一)
    谈论之前需要先谈论一些线程的背景知识其中就有进程地址空间,又是这个让我们又爱又恨的东西。注意:全篇都是在32位的情况下进行的目录背景知识:地址空间:内存:页表:基于以上理解文件缓冲区与虚拟地址:文件缓冲区:虚拟地址:线程:linux下的线程:与进程的澄清:win下的进程:与linux......
  • Linux 系统下工作中常用的shell命令
    目录ls:列出目录内容cd:改变当前工作目录pwd:显示当前工作目录的路径cp:复制文件或目录mv:移动文件或目录rm:删除文件或目录mkdir:创建新目录touch:创建空文件cat:连接文件并打印到标准输出设备上grep:在文件中查找模式find:在文件系统中查找文件这些命令是非常常用的,每个命令......
  • Linux 文件的权限信息解读 chmod修改权限 数字序号表示权限
    ls-l#列出当前文件显示详细信息drwxr-xr-x.2dpctest6Jun1507:45test.txt共分为三部分drwxr-xr-x.:表示文件和文件夹的权限信息dpc:文件,文件夹所属的用户test:文件和文件夹所属的用户组drwxr-xr-x解读d表示为文件夹rwx表示dpc的权限r-x所属用户组......
  • Linux 内核定时器实验
    Linux内核定时器实验内核时间管理简介Linux内核中有大量的函数需要时间管理,比如周期性的调度程序、延时程序、对于我们驱动编写者来说最常用的定时器。硬件定时器提供时钟源,时钟源的频率可以设置,设置好以后就周期性的产生定时中断,系统使用定时中断来计时。中断周期性产生的频......
  • Linux的Terminal调用不出来,一直转圈圈
    后来发现是环境变量的问题[oracle@ora19rac01~]$cat.bash_profile#.bash_profile#Getthealiasesandfunctionsif[-f~/.bashrc];then.~/.bashrcfi#Userspecificenvironmentandstartupprograms#aliassqlplus="rlwrapsqlplus"#aliasrman......
  • 云计算【第一阶段(14)】Linux的目录和结构
    一、Liunx目录结构1.1、linux目录结构linux目录结构是树形目录结构根目录(树根)所有分区,目录,文件等的位置起点整个树形目录结构中,使用独立的一个"/",表示1.2、常见的子目录必须知道目录路径目录作用/root系统管理员root的宿主目录/home普通用户的宿主目录/boot系统内核、......
  • linux的权限管理
    linux的权限管理1.权限介绍和示例root用户权限最高,所以一般对它不做什么权限设置。其他用户就要设定权限并且遵守权限了。文件权限:#文件属性[root@localhost~]#touch1.txt[root@localhost~]#ls-l总用量4-rw-r--r--.1rootroot06月1519:091.txt-r......
  • 【3】Linux常见命令
    常用的操作系统有哪些:【1】Windows操作系统:》不同的版本:WindowsXP,Windows7,Windows10【2】Linux操作系统:》不同的版本:centos6.5,redhat红帽,Ubuntu乌班图centos用的比较多,但版本比较老,服务器首选,内核比较稳定Ubuntu用的也比较多,版本比较新【3】Unix操作系统【4】Macos苹果......