It has long been assumed that the export-after variables in the shell script will affect the environment variables in the terminal that executes the shell. The concept of environment variables is not unique to the shell, but is owned by the process
In the load-spark-env.sh script below the spark bin , there are the following statements: If [-F "${user_conf_dir}/spark-env.sh"]; Then # Promote all variable declarations to environment (exported) variables set-a . "${user_conf_dir}/spark-
In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of a $n, for example, "$" for the first argument, and $ for the second
Syntax structure of case:Case to test item in style string 1] command area 1;;( Style string 2) command area 2;; Style string 3) command area 3;; *) command area;; Esac
Command area, can be a single instruction or multi-line instruction, but
The shell acts as an interface between the user and the kernel in the Linux system, which is used to convert the commands entered by the user into instructions that the kernel can understand, and then to perform the corresponding functions through
There are a number of ways to intercept strings in the shell, ${expression} There are 9 ways to use them. ${parameter:-word}${parameter:=word}${parameter:?word}${parameter:+word} The above 4 alternatives can be used for default values. ${#parameter}
Environment variables
$HOME
Home directory of the current user
$PATH
A colon-delimited list of directories to search for commands
$PS 1
A command prompt, usually a $ character, but in bash,
IFS is the split symbol, the AA BB cc DD separately is $ $ $ $, when i=3, assigned to B DD. [[email protected] test]# cat 1#!/bin/basha= "AA:BB:CC:DD" ifs= ":" I=0for B in $A;d o [$i-eq 3] & & b= $B; Let i++;d One;echo $b; [[Email
I rookie a, first contact with the Linux shell script;Shell script, the simplest function is to write a lot of instructions together, so that users can easily be able to execute multiple commands, and shell script provides arrays, loops, conditions
SedSED: it is called a streaming editor, and its working scenario is typically in the editor, where a piece of text is read in the SED in a row and then output in the specified way, which is its most basic usage.First, the basic operation of
1. BackgroundWhen it comes to shell programming, we have to mention regular expressions, the "old guy" that can look like a new programming language, and let a lot of our just-in-the-box programmers love and hate because they can actually write
Ask for 1-100 and
A. Non-recursive1 #!/bin/bash 2 sum=0 3 str= "" 4 for I in {1..100} 5 does 6 let sum+=i 7 str+= "$i +" 8 done 9 echo ${str%+}= $sumOutput Result:650) this.width=650; "src="
One. grepgrep (Globally search a Regular Expression and Print) is a powerful text search tool , it can use regular expressions to search for text, print matching rows, but does not affect the contents of the original file , and by the return value
Recently, when using shell to write scripts, I want to implement two very simple functions in Python: 1: Determine if a string contains another string. 2: How to implement the list of Python work: 1. Here to share with you.1: Determine if a string
Recently, in order to experiment with the installation of Windows Server Core server, the system without a graphical interface always gives a very complete feeling, we have the idea of security in the end, using the Windows Remote Shell management
Hkey_local_machine/software/microsoft/windows Nt/currentversion/winlogon/shell1) Windows Server 2012,minshell switch to Server Core:Open cmd-> Input "PowerShell", enter "uninstall-windowsfeature server-gui-mgmt-infra–restart" and wait for it to
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service