linux learning 18 shell script variables and logical basis -bash run

I. Review

  1, user management, rights management, install, mktemp

  2, user management:

  3, rights management:

    mode,ownership

    mode:

      user

      group

      other

      r

      w

      x

  4, the command: install, mktemp

Two, bash and bash scripting initial characteristics

  1, the terminal: the terminal attached to the interface program

    GUI: KDE, GNOME, Xfce

    CLI:/etc/shells

  2, bash features:

    a, expand the command line: ~, {}

    b, command aliases: alias, unalias

    c, command history: history

    d, file name wildcard

    e, shortcut keys: Ctrl + a, e, u, k, l

    f, command completion: $ PATH

    g, the path completion:

  3, the characteristics of hash bash command

    a, the results of the previous command to find the cache, that command hash. Note that he will only cache external command, because it is an internal command shell that comes with it is not cached, including hash myself.

[root@localhost ~]# hash 
hash: hash table empty
[root@localhost ~]# ls /root/
anaconda-ks.cfg  hello  inittab
[root@localhost ~]# cat /etc/fstab > /dev/null 
[root@localhost ~]# echo "wohaoshuai" > /dev/null 
[root@localhost ~]# hash 
hits    command
   1    /usr/bin/cat
   1    /usr/bin/ls

    b, Options

      -d: Forget the position of each command has to remember

      -r: forget all remembered locations

[root@localhost ~]# hash 
hits    command
   1    /usr/bin/cat
   1    /usr/bin/ls
[root@localhost ~]# hash -d cat 
[root@localhost ~]# hash 
hits    command
   1    /usr/bin/ls
[root@localhost ~]# hash -r
[root@localhost ~]# hash 
hash: hash table empty

    c, corresponding to the cache storage format is: key-value

      key: the search key

      value: value

Third, the characteristics of the bash: Variable

  1, the program: the composition of instruction data +

    Instruction: provided by the program file

    Data: IO devices, files, pipes, variable

    Program: Algorithms + Data Structures

  2, the variable name + points to memory space

  3, variable assignment: name = value

42:23

Guess you like

Origin www.cnblogs.com/Presley-lpc/p/12076444.html