1.Shell command line writing rules:Multiple commands can be executed on a command line, but required;Long command statements can be expanded with \ on the command line2. Execute Shell Program2.1./test.sh2.2 Bash test.sh2.3 In order to compile and execute the shell-written program in any directory, add the/bin directory
system development in the production environment
-Example of scripts used to check whether the linux system has been optimized in the production environment
4-09-shell array overview definition and addition, deletion, modification, and query of Arrays
4-10-various common definition methods for shell Arrays
4-11-Case Study of Using shell Array Function to check m
How to build a archive file using shell scripting and export the signed IPA file.1. Build Script DescriptionThis shell script is used for Build,xcode workspace source code engineering and is exported as a re-signed IPA file for distributing test installation files and files for submitting AppStore audits. Implement auxiliary product development, test configuratio
contents):Real 3m41.864suser 0m34.224ssys 0m2.102sSo efficiency is barely acceptable.Test of Method Two:Time Awk-f awkfile datafileResults (omission of file contents):Real 2m26.487suser 0m7.044ssys 0m1.371sEfficiency is significantly better than the first one.Then examine the efficiency of method three:Time awk ' Begin{srand ()}{b[rand () nr]=$0}end{for (x in B) print b[x]} ' dataResults (omission of file contents):Real 0m49.195suser 0m5.318ssys 0m1.301sIt's pretty
Http://www.cnblogs.com/xiaowenji/archive/2011/03/12/1982309.htmlHave you ever had this experience, enter the ADB shell at the command line, and then use the command to manipulate your phone or simulator, but those commands are a shrinking version of the common Linux commands, which is very uncomfortable to use. Ever thought about using a more complete shell on Android? Use BusyBox. Whether using the ADB con
Write a script:1. Add 10 users user1 to User10, password with user name, but only if the user does not exist to add;#!/bin/bash# forIinch{1..Ten}; Do if!IDUser$i >/dev/NULL; ThenUseradd user$iEcho "user$i"|passwd--stdin user$iElse Echo "User$i exists" fi DoneDelete the above 10 users#!/bin/bash# forIinch{1..Ten}; Do if IDUser$i >/dev/NULL; ThenUserdel-r user$i >/dev/nullEcho "user$i dele
Overview:Overview:This section describes the array of shell scripting in Linux, advanced string processing, advanced variables, and configuring the user's environment.One, function and positional parameter extension1. TheShift command implements the jump in the position parameter, which squeezes the leftmost parameter650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/86/5B/wKiom1e9EFvAun-AAABG0xL4ac
Shell script simulates Nginx service startup and shutdownNote: 3 slashes////is followed by a representation of the interpretation of the current statement, which must be removed in the actual script#!/bin/bash///defines which scripting language interprets the following statement[-f/etc/init.d/functions]. /etc/init.d/functions///Judge and load system functionsngin
content such as/boot is a specific content)$?: The state returned after the previous command was executed, when the return status value is 0 indicates normal execution, and a value other than 0 indicates an exception or errorDetermine if an error occurs correctly for 0 exception error for non 0 value between 1-127$: The currently executing process/program name (which is the name of the currently executing command or program)Tip: Add Environment variablesVim/etc/profileAt the end of the document
-rsaaaaab3nzac1yc2eaaaadaqabaaabaqcqt3vwy9wo7tksxa4ce1zxglt/ iygy30tdbknv4hw4g5bdus48urtvyljl9cwj/hwvoqbtj5mc7pmmhdmoajih1crztgxkekqfb/xp5clease7ih+wfknqavfhd75+ Yum2mbnbvisdxo+/pj/qfbmywwj6cw6ulpqkpitdjwrlpqdjgqv5h3av0khkzdoa+twdxm0lmqcwwjt7zrupq19caxg5b93ktdgyt/1x4bfct5 /+pcaed9suywenei2io8cx9otae3mryrptln0szt89qp/q+q4sktvjc1nkxhhdp2mahqeiblugulfkgubtejagafswb+ejfv0frdhk6bsj [emailprotected] Note, modify Authorized_keyS permissions Chmod600authorized_keys In addition, set the permissions of th
Parameters:-N does not execute script, only checks syntax for errors-V Output the script contents to the screen and execute the script-X executes the script and outputs the content to the screen-N-VTen module () { eval '/usr/bin/modulecmd bash $*'}#/bin/bashif [$15 ];then "Yes"or "else" No " Fiyes-X[[Email protected] sbin]# SH-'['5']' 2operator expected+ echo NonoExpand:Use PS4 to make debugging output line numbers[[email protected] sbin]#
for the second partition;(3) for Rootfs to provide bash, LS, cat programs and the library files that depend on;(4) Provide the configuration file for grub;(5) The new hard disk is set as the first boot item and can start the target host normally;8. Write a script(1) can accept four parameters: Start, stop, restart, statusStart: Output "starting script name finished."...(2) Any other parameters, all error exits;9, write a script to determine whether a
1. List the directory under the current directory (only one level is required)1 #!/bin/bash 2 for f in ' LS ' 3 do 4 if [-D $f] 5 then 6 echo $f 7 fi 8 done2, the current directory of files (only need a level) listed1 #!/bin/bash 2 for f in ' LS ' 3 do 4 if [-F $f] 5 then 6 echo $f 7 fi 8 done[[Email protected] ~]# date +%f "%T" 2016-02-17 15:54:13Knowledge points : In a
Tags: Configuration ideas nbsp Script Practice post awk bash judgment comparison#!/bin/Bash while : DoRead-P">>>"user [["$user"="Q"]] || [["$user"="Q"]] Break [[-Z $user]] ContinueID$user >/dev/NULL [[ $? -eq0]] Cat/etc/passwd|awk-F:'{print $, $NF}'|grep$user | |Echo "User not exist" DoneThe script implements the target to determine whether the user existsMain ideasThe while do statement implements the l
To see what versions of the Shell:cat/etc/shells system are currently running, the first process that starts is initHow bash Shell debugs:Simply add parameters after the SH command-N: Do not execute scripts, query the grammar within the scripts, if there are errors are listed!-V: The contents of scripts are displayed on the screen before executing the scripts;-x: The scripts content that will be used is dis
Write a script, create a folder, enter a folder, and then use the loop to create a sequential file in the folderIdea: 1. Create the specified folder and go to the folder2. Specify a variable with a value of 0 to allow this variable to be recycled3. Create one document at a time for Each loop until the end of the loopVim create.sh#!/bin/bash#written by Lizheng#about Create FileCD ~mkdir testfileCD testfilefor ((i=0; iTouch Testfile_$i.txtDone650) this.
Enter 2 numbers (x, y) if x equals Y, the output is z=x+y, if x is greater than Y, the output is z=x-y, otherwise the output z=x+yVI number2.sh#!/bin/bash#written by Lizheng#about Panduanecho "Please enter the number"Read XRead Yif test $x-eq $yThen echo "z= $x-$y"Elif Test $x-gt $yThen echo "z= $x-$y"else echo "z= $x + $y"Fi650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8B/50/wKioL1hJd0rB2jlvAAALxj75lmM431.png-wh_500x0-wm_3 -wmp_4-s_30509
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.