15.LSB

来源:互联网 发布:新塘网络教育 编辑:程序博客网 时间:2024/05/07 13:03
  1. Unix
    SVID: AT&T UNIX System V Interface Definition
    POSIX: Portable Operating System Interface
    BSD

  2. LSB: Linux Standard Base

The set -A syntax to assign values to an works in all versions of ksh. You only need to use the alternate typeset -a syntax if you run your script under bash. The easiest solution would be to always run your code under ksh. All your platforms have ksh93, so just use that: on Linux, install the ksh package and use it instead of bash. Under ksh93, you can also use a=(aModeTrace false false false false); this also works in bash but not in ksh88 (AIX’s ksh is ksh88 but there is also aksh93`).
If you absolutely need a script that’s portable between ksh88 and bash, you can put the evalhackery in functions. Only whole array assignment needs to be wrapped in this way, the syntax for access to individual elements, array size and individual element assignment is the same. Use the shell, rather than the operating system, to choose the implementation.

set_array ARRAY ELEMENT0 ELEMENT1 …

Set the variable ARRAY to contain the specified elements. Like

ARRAY=(ELEMENT0 ELEMENT1 …), but also supply a method that works in ksh88.

if [[ -n $BASH_VERSION ]]; then eval ‘

set_array () { eval “shift; $1=(\”\$@\”)”; }’
else eval ‘

set_array () { typeset __set_array_var=$1; shift

set -A $__set_array_var -- "$@"

}’
fi

  1. /etc下重要的配置
    fstab
    hosts
    inittab
    mtab 当前挂载的文件系统列表
    services TCP/IP服务和它们的端口服务
    shells 系统支持的shell
    sudoers
    login.defs useradd创建新账号,读取该文件

  2. 日志文件/var/log
    boot.log
    messages 系统日志
    secure 安全日志,包含用户登录等

  3. sudo
    sysomc ALL=(root,oracle) NOPASSWD:/bin/su,/home/sysomc/tools/vmp/tmp/params.sh,/home/mttoolserv/bin/MTtoolDaemon.sh -
    sysomc ALL=(root,oracle) NOPASSWD: ALL
    sysomc ALL=(ALL) NOPASSWD: ALL

scu ALL=(root) NOPASSWD:/usr/sbin/useradd,/usr/sbin/userdel

  1. socket
0 0
原创粉丝点击