1.Shell IntroductionThe shell is a program written in C that is a bridge for users to use Linux. The shell is both a command language and a programming language. A Shell is an application that provides an interface through which users access the service of the operating system kernel. Shell programming, like Java, PHP programming, as long as there is a text editor can write code and a can explain the execution of the script interpreter can be common i
Linux Command: bash language details, linux Command bash details
Bash is a command interpretation language. It can execute commands that read standard input or files, execute commands, and rebound shell with nc!
Basic syntax
Bash-c command
Root @ kali :~ # Bash-c whoami
Learning bash notes-input and output, bash hide output1. I/O redirection
The I/O redirection is as follows:
Cmd1 | cmd2: pipeline that receives the standard output of cmd1 as the standard input of cmd2.
> File: redirects standard output to file.
> File: redirects the standard output to file. If the file exists, it is appended
> | File: Even if noclobber is set, the standard output is still fo
Bash Variable type:Environment variablesLocal variables (local variables)Positional variablesSpecial variablesLocal variables:Set Varname=value: scope for the entire bash process;Local variables:Local Varname=value: Scope is the current code snippet;Environment variable: The scope is the current shell process and its child processes, (the action variable itself uses VARNAME, the value of the action variable
Help for Power Users and SYS adminsbash pocket reference
If you want to get to the heart of Mac OS X, Linux, and other UNIX systems, you need to know how to work with the bash shell.
If you want to learn more about Mac OS X, Linux, or other UNIX systems, you must understand how to deal with Bash.
This concise little book puts all of the essential information about Bash
BASH command and usage summary, bash usage Summary
I need to write a Linux script in my recent work and use a lot of BASH commands. To avoid forgetting it later, I will write them down here one by one. It may be messy. Just take a look. If something is wrong, you are welcome to correct it.
1, export VAR =...
This command runs in Shell to make the script that runs
Bash condition test-empty string confusions: bash condition string
You can use-n or-z to check whether a string is null. According to the meaning of the operator, if VAR is null or undefined, the-n test result should be false, and-z should be true. Otherwise,-n is true and-z is false.
The conditional test list is used, that is, "[-n $ VAR] echo TRUE". If TRUE is output, the conditional test result is TRUE.
In our work, we often need to replace and add URLs from the text using SED. However, we often encounter the ambiguity in the SED of special characters in the URL so that it takes a lot of time to test when writing a bash script. So what are the special characters that create ambiguity?
#这些都需要转义, |, \,/, ^, *, (,), [,], {,}, ',?
Which, to ",/,?" " for the most important needs to transfer. For example:[Email protected] test]$ url="HTTP://
Linux new user with ssh remote login display-bash-4.1 $, ssh-bash-4.1
There are many methods on Baidu, most of which are in the form of adding PS1 code in. bash_profile, and then logging on to the account again... This method is difficult to achieve the desired results.
The root cause of this problem is the lack of Shell environment!
[Root @ localhost ~] Su-papi1Last login: Wed Jan 24 04:11:41 EST 2018
0. Interpreter (interpreter) mode definition:given a language, defines a representation of its grammar, and defines an interpreter that uses the representation to interpret a sentence in a language. belongs to the behavioral pattern.The interpreter pattern is rarely used in actual system development because it can caus
Ruby Environment variablesThe Ruby interpreter uses the following environment variables to control its behavior. The ENV object contains a list of all the currently set environment variables.For Unix, use the ENV command to view a list of all environment variables.
Hostname=ip-72-167-112-17.ip.secureserver.net
rubypath=/usr/bin
shell=/bin/bash
TERM=xterm
histsize=1000
ssh_client=122.169.131.179 1742
There's a question on StackOverflow about the comparison between Java and Python, and there are questions about why Java's runtime is called a JVM, and Python is called interpreter.This problem is estimated not many people think, first look at Wikipedia to see the definition of virtual machine.There are 2 definitions of virtual machines, one is a VMware-like system virtual machine, and the other is a virtual machine called a program virtual machine, such as JVM,CLR, which is the most common virt
StatementIn order to improve the quality of teaching, my college is planning to prepare C language teaching materials. "Write the Interpreter in C language" series of articles after finishing will be revenue book "comprehensive Experiment" chapter. Therefore, the main reading of this series of articles for students who have just finished C language (not requiring data structure and other knowledge), so the wording is more verbose, do not be offended.
SHELL script strategy (learning notes) -- 1.5 bash environment configuration process, -- 1.5 bash
From the perspective of user login, shell is divided into two types:
Logon shell: If you log on through a terminal, use the su-username command to switch users.
Non-interactive shell: for example, you can use the su username command to switch between users. Open the command terminal and shell script in the grap
There are multiple types of Shell in Linux, the most common of which are Bourne shell (SH), c shell (CSH), and Korn shell (Ksh ). Each of the three shells has its own advantages and disadvantages. The Bourne shell is the original shell used by UNIX and can be used on every UNIX. Bourne shell is excellent in shell programming, but it is inferior to several other shells in dealing with user interactions. The default shell in Linux is the Bourne again shell, which is an extension of the Bourne shel
Linux Bash Shell learning notes, bash learning notes
Parameter extension:
1. The parameter referenced by the name is called a variable.2. Parameters referenced by numbers are called positional parameters.3. Parameters referenced by a specific symbol have special meanings and purposes, and are referred to as Bash's special internal variable reference.
Basic Parameter extension:Character $ will guide paramete
Interpreter pattern (interpreter pattern): Given a language, defines a representation of its grammar and defines an interpreter that uses that representation to interpret sentences in the language.Here is a demo of the Interpreter mode:1 #!/usr/bin/env python2 #-*-coding:utf-8-*-3 4 __author__='Andy'5 """6 Liar design
Bash variable types and bash Variables
Local variable: it acts on the Current shell and is invalid for other shell processes other than the current shell and the Current shell Sub-processes.
Assign a value to a local variable
name='value'
Value can be a string or a variable. The referenced variable uses $ {name}, $ name, or ''.
Note: single quotes are strongly referenced, while double quotes are weak refere
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.