One, do not want to manually enter the method1. Install expect tool: sudo apt-get install tcl TK expect2. The contents of the script file are as follows:#! /usr/bin/expectSpawn sudo apt-get updateSend "zhoushuo\r"InteractSecond, want to manually
Video linkPotatoes:Station B:Directory of this chapter:1. Bash Shell1.1 What is a shell? (We communicate with the kernel core through the shell, enabling kernel to manipulate the hardware)1.2 System shell and/etc/shells function (Cat/etc/shells, you
The first time to write shell scripts, no experience, is to write directly, or to go through the process ( ̄▽ ̄) ~*-----------------------------------------------------------------------In general, three steps, let's do it with me.---------------------
[email protected] ~]# cat sanjiaoxing.sh #!/bin/bash# Crushlinux# 2017-04-10 Read-p "Please enter the length of the equilateral triangle one side:" Longfor ((a=1;aa;b--)) #控制空格输出 Do echo -n "" Donefor C in ' seq 1 $a ' #输出所在行数相同的数字个数do echo-n "$a"
Positional parameter variablesmyscript.sh ARGU1 ARGU2Citation method:$, $, ..., ${10}, ${11}, ...When executing scripts on Linux, place the parameters behind the script (myscript.sh argu1 argu2), $n represent the parameters to be executedExercise:
Reference: http://www.cnblogs.com/binbinjx/p/5680214.htmlWhen doing bulk software installation automation, you like to use the configuration file to change the parameters, how to read the configuration file configuration through the shell? Refer to
Bash is a powerful scripting language, which is the default shell in many Linux occurrences, supports variables and special characters, and looks at what special characters it has:; Command delimiter, you can write multiple commands in one line;;
First, the implementation of the discovery of the ADB shell into the device and no longer continue to execute/system/plugin/....ExitAll the online search is bat file call adb shell, no sh file call adb shell does not go down, look for other
Instance: Generate temporary file record Apache process number, kill Apache process, Delete temp file 1#!/bin/Bash2#create_log. Sh3 4#1. Get the process number to all httpd applications5#2. Deposit the process number in a temporary
Pipe: grep foo/path/to/file | Grep-n-K 3 | MoreThe actual process is the opposite of what we intuitively believe, and it is best understood through the actual process. The first thing to run is more, and its input is connected to a pipeline. Then it
First, Background introductionDBA Daily Update Insert|update More, delay a lot of time. The development of tools, although the user password in the script encryption and strict operation, but carefully query internal logic or may reveal the password,
Transferred from: http://blog.csdn.net/iamlaosong/article/details/54728393 Recently, to compile a shell script to process the data, you need to detect the existence of the data file, the file name contains the date, so you need to generate the date
One: The type of shell that stands in terms of user login:Login Shell: Normal usually a terminal login Su-usernamesu-l USERNAMEOpen Command Window under non-login SHELL:SU username graphics terminalTwo: Bash configuration file:Global
File LookupFind------directory------1. Search Conditions2, after the file search processing----------------1. Search Conditions 1.1) Matching of file names && Multi-condition name matchingYou can use regular expressions to match, and-a or-o in
Shell programming: For Hadoop programmers, it is often necessary to familiarize yourself with shell programming, because the shell can easily run program code.1. Shell file format: xxx.sh#!/bin/sh---The first line of the shell file must be written
I am not a professional Linux, usually do not work in Linux programming, self-learning some Linux shell programming, forget to learn, learn to forget, efficiency is not high. Today is the right to review it.Think of a scenario where you get a
Take a look at the logic operations in bash before you learn the basics of Shell programmingBash features multi-command executionCommand;command1 ... Sequential execution structureSelect the execution structure:Logical operation:VS: Logical
In awk, it's not possible to use shell variables directly.The AWK-V option allows awk to use the shell variableTime=60Awk-v time= "$TIME" ' begin{fs= ' | '} {if ($7>time) print $} 'Note: In awk, time cannot be added to the $ symbol.Online said the
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.