Determine whether the shell script code exists in the file

CopyCode The Code is as follows :#! /Bin/sh # Determining whether a file exists # Link: www.jb51.net # Date: 2013/2/28 Mypath = "/var/log/httpd /"Myfile = "/var/log/httpd/access. log" # Here, the-x parameter determines whether $ mypath exists

Analysis of Shell custom functions and parameter calls

I. define functions CopyCodeThe Code is as follows: function fname () { Statements; } OrCopy codeThe Code is as follows: fname (){Statements;} Ii. Call Functions You can call a function by using the function name:$ Fname; # execute a

Use shell to extract and update DB2 data

The DB2 tutorial is: use shell to extract and update DB2 data. The shell written for work needs to process the DB2 database Program Use shell to extract and process DB2 data. # SQL Definition SQL = "select AAA, BBB, CCC from mytbl1" #

Call Shell. Application simple functions in vbs

Set OS = Createobject ("wscript. Shell ") Set os0 = Createobject ("Shell. Application ") Do Input1 = inputbox ("Please select:" + CHR (13) + CHR (13) + _ "1. Minimize all windows" + CHR (13) + _ "2. Restore window status" + CHR (13) + _ "3. Uniform

Shell script code for linux server security reinforcement

Copy codeThe Code is as follows :#! /Bin/sh # Desc: setup linux system security # Author: corzd # Powered by www.freebsdsystem.org # Version 0.1.2 written by 2011.05.03 # Account setup Passwd-l xfsPasswd-l newsPasswd-l nscdPasswd-l

Linux shell provides two methods to obtain a single character in the specified range of user input.

Method 1: Copy codeThe Code is as follows: echo 'echo {a. z} ''echo {A. Z}'>/tmp/letterfile While read-p "please input a letter:" letter Do ('Awk-v var = "$ letter" 'In in {print length (var)} ''= 1 )) & grep-q $ letter/tmp/tmpfile & break Done Rm-f/

How to control the execution sequence of linux shell commands

&&Command 1 & command 2: If the command is successfully executed, run the command.[Jb]/usr/xxxx/ytcclb> ls-l test. SQL-Rwxr -- r -- 1 xxxx group 225 Nov 15 test. SQL[Jb]/usr/xxxx/ytcclb> cp test. SQL test. bak & echo "coping file OK! "Coping file OK!

Linux shell Array

Bash shell supports only one-dimensional arrays, but there is no limit on the number of parameters. Declare an array:Declare-a array(In fact, you don't need to declare it. You just need to assign values to variables in the array mode. BASH knows

Extract the shell script code of alert log On oralce

Extract the alert log shell script of oralce on the current day Copy codeThe Code is as follows: #/bin/sh # Get alert of everyday # Then name of file is everyday_alert.sh Dir = "/oracle/admin/bbdz/bdump" Num = $ (cat-n $ {dir}/alert_bbdz.log |

Shell scripts for two backup Databases

Back up database shell script 1 Copy codeThe Code is as follows :#! /Bin/bash # Specify the running script shell # Run the script to grant the user the execution permission Bakdir =/backup Month = 'date + % m' Day = 'date + % d' Year = 'date + %

Introduction to searching and replacing Shell script Learning Guide

3.1 search for textGrep: use the basic regular expression (BRE) defined by POSIX ).Egrep: use an extended regular expression (ERE ).Fgrep: Quick grep. Use an optimized algorithm to match a fixed string instead of a regular expression. 1992 POSIX

Shell script Learning Guide-text processing tools

4.1 sort text 4.1.1 sort rowsIf the command line option is not provided, the entire record is sorted by the order defined by the current locale.In the traditional C locale, that is, the ASCII order. 4.1.2 sort by fieldsThe-k option is followed by a

A shell script used to count the hard disk usage of CPU memory

Copy codeThe Code is as follows :#! /Bin/bash # This script is used for describle CPU Hard Memery Utilization Total = 0 Idle = 0 System = 0 User = 0 Nice = 0 Mem = 0 Vmexec =/usr/bin/vmstat Which sar>/dev/null 2> & 1 If [$? -Ne 0] Then Ver = 'vmstat-

Shell script code for concurrent database stress testing

Copy codeThe Code is as follows :#! /Bin/bash #********************************# # Run fun in the concurrent background # # For wanggy 2012-01-25 # # Note :# # Fun_num number of times the fun function runs in the background # # SQL _num SQL

Introduction to shell comparison

Compare shell strings and determine whether the string is a number Binary comparison operator, which compares variables or numbers. Note the difference between numbers and strings. Integer comparison -Eq equals to, for example, if ["$ a"-eq "$ B"]

Code used to determine whether a process exists in Linux Shell

1. Use pgrep to match the name Copy codeThe Code is as follows: if test $ (pgrep-f $1 | wc-l)-eq 0 Then Echo "the process does not exist" Else Echo "process" Fi The following is a supplement:Processes in the current system: Apple @ ubuntu :~ $

Using openrowset for shell penetration

Using openrowset for shell penetration To get the SQL injection point, we first thought of the backup webshell. We threw it in the NB and found that the SQL error information was blocked and the physical path was not obtained. Then we wrote a PP

Linux Shell Study Notes day 5

Day 5: function and Task Scheduling Function advantages Divide and conquer f Collaboration Convenient Management Easy to maintain Function Structure Function Name () { Command 1 Command 2 Command 3 } Function parameter transfer Passing parameters to

Fourth day of linux Shell Study Notes

The scripts for this lesson are also shared in share. Day 4: cyclic structure Content outline: Application Instance Analysis For Loop While Loop Principle of for Loop Achieve results According to yesterday's menu modification. After selecting 1, 2,

Summary of five methods for Shell. Application to execute commands

When I first wrote this version by Ma, I tested the simplified and traditional versions 2003, which should be easy to use. I guess it is probably related to the patch ms06014 on 2003. Parse proposed a solution in the freezing point forum. I studied

Total Pages: 541 1 .... 437 438 439 440 441 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.