Shell script record

Source: Internet
Author: User

Execute another shell script in the shell script

You can execute another shell script (or non-executable file, mainly used to obtain the value of some variables) in one shell script :. file name (including path) or variable = file name (including path ). $ variable Note: there is a space behind the dot. In this way, some variables declared in other files can be referenced in the later part of this shell script. Manually add a startup service in Linux

Run CAT/etc/rc. Local to check this file. You do not need any help manuals or documents. After reading this file, you will have a better way to add a startup service.

#! /Bin/sh-e
#
# RC. Local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "Exit 0" on success or any other
# Value on error.
#
# In order to enable or disable this script just change the execution
# Bits.
#
# By default this script does nothing.

./Var/www/sphinx/restart. Sh

Exit 0

 

Crontab

 

# Full-text search
30 1 ***/bin/sh/var/www/sph?/ sph=. sh;

# Chat room online user check script
*/1 ***** PHP/var/www/ccccccc/_ tools/update_online_users.php

 

 

Linux if

# Pimei

Site = 1
If [$ site = 1]
Then
/Usr/local/coreseek/bin/indexer -- config/var/www/sphinx/www.site.com/pre_portal_article_title/pre_portal_article_title.conf -- all
/Usr/local/coreseek/bin/searchd-C/var/www/sph?/ www.site.com/pre_portal_article_title/pre_portal_article_title.conf
/Usr/local/coreseek/bin/indexer -- config/var/www/sphinx/www.site.com/pre_portal_article_and_tag/pre_portal_article_and_tag.conf -- all
/Usr/local/coreseek/bin/searchd-C/var/www/sph?/ www.site.com/pre_portal_article_and_tag/pre_portal_article_and_tag.conf
Fi

Related Article

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.