Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux variable learning experience     - Linux basic introductory tutorial ---- simple text processing (Linux)

- Forbid screen change the window size when creating a new window under CentOS (Linux)

- These days have been tossing in the Linux under the ASP.NET 5, on the next in the other operating systems in the ASP.NET 5 or. NET applications, in order to complete the MS VM (CoreCLR) run is not far Reach, the effect of the application.


- Linux C source code (sockettype: socket descriptor determination function) (Programming)

- Perl loop (Programming)

- Oracle for Oracle GoldenGate to achieve a one-way synchronization DDL operations (Database)

- init level settings for Linux / etc / inittab file into six (restart) or does not support the level of solution (Linux)

- [SHELL] MySQL primary recovery solution from + Keepalived online (Server)

- How do you access Dropbox Linux command line (Linux)

- Linux garbled file delete method (Linux)

- The Concept and Semantics of Java Memory Model (Programming)

- Each catalog Detailed Linux (Linux)

- Stunning exclamation point at the Linux command line (Linux)

- Linux Shell Understanding and Learning (Linux)

- Quickly locate the mistakes by gdb location (Programming)

- CentOS Linux Optimization and real production environment (Linux)

- Getting Started with Linux: Learn how to install and access CentOS 7 Remote Desktop on a VPS (Server)

- The most simple drive to write and test procedures under linux (Programming)

- ORA-12547: TNS: lost contact error Solution (Database)

- Use Spring cache and ehcache (Programming)

  Linux variable learning experience
  Add Date : 2018-11-21      
  Some time ago to learn about Linux variables, there are now three points summarize require special attention:

The difference between variable and Linux C / C ++ variable
Linux reference variables
Linux specific commands to replace the variables
Let me talk about the first point, Linux is more like a macro definition variable, but can be changed to refer to the content. That is, in C / C ++, a variable is only assigned to different types of data, such as int, char, ptr. But in Linux, variables can be assigned to any form of content, such as string, for this point, it is more like C / C ++ macro definitions.
Due to the different contents of the variable contains, Linux and C / C ++ variable reference different nature. Linux in general there are two forms of variable references:

$ Var: The wording is very common and simple, but in order to accurately express and reduce the difficulty of reading, the next method is recommended;
$ {Var}: This wording better reflects the specific variables, not the intention not bring little trouble.
Note: assign values ​​to variables when there are two writing:

Single quotation marks '': a single quote inside the content intact assigned to a variable, even if it contains other variables;
Double quotes "": double quotes inside the variable will be replaced by a reference to the actual content of the variables.
About variables command substitution, in the format $ (commend), nature is to be executed as a result commend the content assigned to other variables or for other purposes.
Here to say something about command to replace some in-depth analysis (personal opinion):

Replace command relationship and pipes:
For pipelines, it is the relationship between two commands (process) between and must comply with three conditions:
Previous command must be executed properly;
The previous command produces standard out information;
After receiving information about a command parameter.
And then to pass the results of a command to complete before the next command behavior and only the behavior between the two commands.
For command substitution, it does not have these constraints, as long as the command is executed, regardless of the outcome, the results will be taken out of operation assigned to other variables or for other purposes.
Command substitution, and alias relations:
For the alias, it can be used as an alias command, in fact, just another name, like typedef, it represents the result of the command itself, rather than its execution;
For command substitution, it was the result of command execution rather than the command itself.
- How to restart after a crash Cinnamon (Linux)
- Linux disk partition batch format mount script (Linux)
- PXE install CentOS 6.4 (Linux)
- To install the Ubuntu Touch emulator on Ubuntu (Linux)
- To configure parameter configuration and software installation and uninstallation under Linux (Linux)
- The need to avoid a gap of InnoDB lock (Database)
- Oracle11g CRS-0184 Problem Solving (Database)
- Django Web dynamic three linkage (Programming)
- How to modify the Linux NIC eth1 to eth0 (Linux)
- Linux beginners should know 12 commands (Linux)
- Python object-oriented programming (Programming)
- Android Notification (Programming)
- 3 tips Linux command (Linux)
- Storm basic framework for analysis (Programming)
- Ubuntu Thunderbird 24.4.0 (Linux)
- Install the open source database PostgreSQL 9.4 and phpMyAdmin on Ubuntu (Database)
- Modify Linux terminal prompt path length (Linux)
- Configuring Eclipse Note Templates (Linux)
- Memcached distributed caching (Server)
- Kali Linux virtualbox rc = Error 1908 workaround (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.