1、 Write a command containing 、 Variables and process control statements /var/log Of messages Of the log file shell Script .(P26)(11-21)

2、 utilize $0 and (dirname、basename) Get the directory name and file name of the current path (P62)

3、 There is only one process after executing a script many times in the implementation system (P68)

4、exec Function of sample (P71)

5、shift Command use cases (P72)

6、 Remove... From all filenames _finished character string (P78)( It must be a file , It can't be a catalog )

7、 Delete 7 A backup of expired data two days ago (P82)

8、 Input two numbers to add, subtract, multiply and divide the calculator function (P89)

9、 monitor web Server status , If both visits fail , Call the police (let Use cases )(P92)

10、 adopt read Continue to read in the example you are typing (P95)

11、 The number of words in the print statement is not greater than 6 The sentence of (P99)

12、 adopt expr Determine whether the file extension meets the requirements

13、 Calculate input through a command 1+2+3+…+10 The expression of , And make use of bc The command computes (P100)

14、 With read The enterprise case of command read in and parameter transfer (P105)

15、 Enter or pass in a character or number by command , If the number passed in equals 1, Then print 1; If the number passed in equals 2, Then print 2. Otherwise, it will prompt that the input is wrong , Exit procedure .(P132)



1、  Write a command containing 、 Variables and process control statements /var/log Of messages Of the log file shell Script .(P26)(11-21)

  


2、 utilize $0 and (dirname、basename) Get the directory name and file name of the current path (P62)


3、 There is only one process after executing a script many times in the implementation system (P68)

python Code , Hang in the air

 #!/usr/bin/python
# import os,signal,time
file='/tmp/pid'
if os.path.exists(file):
print 'the %s is exist.' % file
f1=open(file,'r+')
pid=f1.readline()
pid=int(pid)
os.kill(pid,signal.SIGKILL)
print "%s was killed and will be cleanup" % pid
f1.truncate()
pid=os.getpid()
f1.append(pid)
time.sleep(300)
else:
f1=open(file,'w+')
pid=os.getpid()
f1.write(str(pid))
time.sleep(300)

4、exec Function of sample (P71)


5、shift Command use cases (P72)


6、 Remove... From all filenames _finished character string (P78)( It must be a file , It can't be a catalog )  http://blog.51cto.com/oldboy/711342

      


7、 Delete 7 A backup of expired data two days ago (P82)

        


8、 Input two numbers to add, subtract, multiply and divide the calculator function (P89)

          


9、 monitor web Server status , If both visits fail , Call the police (let Use cases )(P92)


10、 adopt read An example of continuously reading in integers (P95)

       


11、 The number of words in the print statement is not greater than 6 The sentence of (P99)


12、 adopt expr Determine whether the file extension meets the requirements (P98)


13、 Calculate input through a command 1+2+3+…+10 The expression of , And make use of bc The command computes (P100)


14、 With read The enterprise case of command read in and parameter transfer (P105)

               


15、 Enter or pass in a character or number by command , If the number passed in equals 1, Then print 1; If the number passed in equals 2, Then print 2. Otherwise, it will prompt that the input is wrong , Exit procedure .(P132)

1、My Scripts More articles about

  1. Two 、npm scripts

    One . Execution principle install npm package , It will package.json bin Field added to node_modules bin Inside , Create the corresponding .cmd file , therefore : for example : "scripts": ...

  2. 4、My Scripts

    Script directory list 1. stay windows Compiling shell Script utilization dos2unix Format the command (P308) 2.bash Command parameter debugging (P309) 3. Use set Command debugging part of the script content (P312) 4. Development scripts ...

  3. 3、My Scripts

    . use for Loop batch modify file extension (P240) . Use the professional renaming command rename To achieve . By scripting sshd.rsyslog.crond.network.sysstat The service starts automatically when it is turned on (P244) ...

  4. 2、My Scripts

    http://www.cnblogs.com/image-eye/archive/2011/10/26/2220405.html      Notes explain 1. Print selection menu , Follow the options to install different web clothing ...

  5. mvc in Scripts.Render、Styles.Render

    One . To configure BundleConfig.cs file 1. In the first App_Start Inside BundleConfig.cs In the document Add... To include css file 2.BundleConfig It's a new addition from Microsoft One hit ...

  6. MVC in Scripts.Render、Styles.Render

    stay ASP.NET MVC In the project , You can take advantage of Scripts.Render.Styles.Render Unified load js.css file , Need to use BundleConfig Class to Add Various Bundle, for example :b ...

  7. Fix "Missing Scripts"

    One .Missing Scripts( Script reference missing ) Look at the two pictures below Warn( Script reference missing ), In some cases, we come across this warning . Two . terms of settlement Reference material http://unitygems.com/la ...

  8. You have to know 28 individual HTML5 features 、 Tips and techniques

    Be careful : A few times a week , This list will update some new tips , Final , This article will be a super useful resource .//zxx: The ugly talk is in the front , I don't have time to update , therefore , Even on your daughter's wedding day , This article is still 28 item The development of the front end is so rapid , Be careless ...

  9. Study 28 individual HTML5 features 、 Tips and techniques

    The present ,H5 It's too hot , Write down this article , Seriously understand HTML5. HTML5 The earliest should be 09 It was put forward around 2000 , However, due to browser compatibility , It hasn't been widely used , Recently, it is also because of the development of mobile terminals , drive HTML5. Return to positive ...

Random recommendation

  1. String.prototype.substr()

    summary substr()  Method returns a substring from a specified position to a specified length in a string . grammar str.substr(start[, length]) Parameters start Start extracting the position of the character . If it's negative , Is regarded as   ...

  2. Source Insight Multi label plug-in

    Source Insight It's not just a powerful program editor , It also shows reference trees,class inheritance diagrams and call trees.Source Insig ...

  3. php Calculate string length :utf8 code , Including Chinese

    php Calculate string length :utf8 code Chinese as 1 Character processing (strlen The default is two characters ) Upper function : /** * Calculation UTF-8 String length * * @param string $str * @ret ...

  4. [T] Various strings Hash Function comparison

    Commonly used strings Hash Functions and ELFHash,APHash wait , They are very simple and effective methods . These functions use bit operations so that each character has an effect on the final function value . In addition to MD5 and SHA1 The hash function represented by , These functions are almost ...

  5. More packaging , Less openness . Strongly recommended C++ Standard addition class The injection mechanism between

    Recently, I changed the engine code ( For your own components ), It is found that some interfaces are only accessed by specific classes and their internal functions , But do not use the form of friend declaration for data access -- Of course, ordinary non virtual This means that overloading is not recommended . therefore : ...

  6. IOS Software internationalization ( localization Localizable)

    IOS Software internationalization ( localization Localizable) iPhone It's the phone that supports the most languages , It supports languages of all countries and Chinese minority languages such as Mongolia , That's why so many people use apples . At this point, we still need to learn more about our own brands . ...

  7. Java Data types are used in practical development

    In the front post , I've already introduced Java The container of the core IO etc. , Now let me talk about java Data types in . stay java in , Everything is an object ( This sentence means java In most cases, objects are used ), Very few are not objects , There is also a corresponding ...

  8. 201521123044 《Java Programming 》 The first 6 Weekly learning summary

    1. Summary of this chapter 1.1 Object oriented learning is over , Please use mind map , To encapsulate . Inherit . Draw a mind map for the core concept , Make a summary of the object-oriented thinking . notes 1: No more keywords and content , But the connection between concepts needs to be clear , Content coverage ...

  9. error:org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException

    problem : The method called is in an interface class , But I didn't inject the called class solve : stay UserEntity with @Autowired @Controller public class MainController { ...

  10. read Device Driver Programmer Guide note

    read Device Driver Programmer Guide note xilinx Drive naming rules With X start Source file naming rules With x Lead Low level header file and high level header file The key is coming. , About the use of pointers among XDev ...