1 scripting[Email protected] ~]# vim/root/yum.shScript content:#!/bin/bashrm-rf/etc/yum.repos.d/*echo "[110]name=110Baseurl=http://192.168.4.254/rhel7//yum Source to see the actual change, it is best to use the network Yum source, to ensure that
Native bash does not support simple math operationsWhen you are beginner, you can use $ (()) and expr to implementUse $ (()) to achieve:#!/bin/bash# file name: Test.shecho $ ((1+3)) #命令行第2个参数和第3个参数求和 # At this point the + number can be added without
What is a shell?The shell is the user interface of the system, which provides an interface (command parser) that the user interacts with the kernel, and the shell receives the user's input command and sends it to the kernel for execution, such
(1) awk principleThe principle of awk is to process the data in a file line by row, find content that matches what is given on the command line, and then program the next step if a match is found. If no match is found, continue with the next line.(2)
OneScript code: test.sh"Shell passed argument instance!" "; "file name executed: $"; "The first parameter is: $ $"; "The second parameter is: $"; "The third parameter is: $ $";Execute the file name:./test. SH The first parameter is:1 the
Shell TutorialsShell is a C language program, he is a user using Linux bridge, Shell is both a command language, but also a programming language.The Shell refers to an application that provides an interface through which users access the operating
Test statement format: [conditional expression]A few common forms:[-D/ETC] to determine if/etc is a directory type,[-e/etc/php.ini] Determine if the/etc/php.ini file exists[-f/etc/php.ini] Judge/etc/php.ini is not a general
$ default variable in 1.shell
$n $ $ for the first argument, and $ for the second argument ...
$# Number of command-line arguments
the name of the current program
$? The return code of the previous command or
vim/root/7.sh#!/bin/bashX=$[RANDOM%10+1]Read-p "[1-10] you guessed:" CaiIf [$cai-eq $X];thenEcho, congratulations on your guess.Exitelif [$num-gt $X];thenEcho's a big guess.ElseEcho's too small.Fivim/root/6.sh#!/bin/bashRead-p "Please enter a
1. Create a folder script:#!/bin/bash#mkdirmkdir/home/img/pages/savedpictures/mission/xinlangweibo/$12. Query whether the folder exists:#!/bin/bash#find dirfolder= "/home/img/pages/savedpictures/mission/xinlangweibo/$1/" if [!-D "$folder"]; Then #no
The use and setting of a variable (note that there can be no spaces before and after the equals sign)1. ReadRead the input from the keyboard assignment to the variable, using the following method[Email protected]:/opt/android-sdk/sdk/# read
When you write a shell script, you encounter some long-awaited commands, and to make the user look more comfortable, add some display to make the script appear to be running instead of stuck.So I did my own research and wrote the two scripts to
Shell Process ControlUnlike Java, PHP and other languages, SH's process control is not empty, such as (the following is the PHP Process Control notation):PHP if (Isset ($_get["q"]) { search (q);} Else { // don't do anything }You can't write
1. Standard input, standard output and standard error outputLinux system open 3 files, standard input, standard output, standard error output.Standard input: Enter data from the keyboard, i.e. read data from the keyboard.Standard output: Outputs the
Kali System Preparation:Copy the following Ruby code into the/USR/SHARE/METASPLOIT-FRAMEWORK/MODULES/EXPLOITS/WINDOWS/SMB/MSH_SHELL.RB directory (note the code indentation OH):# # # This module requires metasploit:https://metasploit.com/download#
1. What is a scriptThe shell script is actually a plain text document, we can edit this document, and then let this file Help usExecute more than one instruction at a time, or achieve some specific functionality.To install a certain logical
The shell commonly used file judgment operators are as follows:-e file is present-F file is a normal file (not a directory, device file, linked file)-S means that the file size is not 0-D Indicates whether the file is a directory-B indicates a block
Shell after class summary
High wavesArchive: Learning NotesDecember 4, 2017 13:31:08
Shortcut keys:Ctrl + 1 title 1Ctrl + 2 title 2Ctrl + 3 title 3Ctrl + 4 ExampleCtrl + 5 Program CodeCtrl + 6 Body
Format
? Runtime.getruntime (). EXEC (cmdstring), if the parameters in cmdstring at this time (such as the CP file file name) contain special symbol spaces, then an error occurs, because the source code will follow some special characters ("\t\n\r\f",
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.