zoukankan      html  css  js  c++  java
  • Shell study note

    5.1


    printenv

    view Global variables

    bash

    new shell

    set

    Global variables and local variables

    export test

    Local → Global, so it can be accessed in both subshell and main shell.

    unset test

    Delete a variable, no $ needed.

    PATH=$PATH:...

    append PATH, no “” needed, export needed to make it global.

    .bashrc

    define own aliases


    User-defined variables are lower-cased; while sys variables are upper.

    test=testing;

    remember there is no BLANK;

    bash: new a shell, the subshell has no $test variable for it is user-defined; so it is with the subshell.

    To fix this, we can “export test”, and NO $ needed.

    When unset a global var, it only influent the subshell who execute this cmd.

     

    # add a alias

    echo "alias ll='ls -al'" >> /home/joker/.bashrc

  • 相关阅读:
    pxe基于虚拟机的自启动
    time & datetime
    python文件读写操作
    lambda与常用内置函数
    python基础
    python day2:python 初识(二)
    mysql select
    python day1:初识Python(一)
    linux命令总结
    lvs/dr配置
  • 原文地址:https://www.cnblogs.com/xiaochou/p/Shell_study_note.html
Copyright © 2011-2022 走看看