4 ways to execute shell scripts in Linux summary

Article Source: http://www.jb51.net/article/53924.htmThis article mainly introduces the 4 methods of executing shell scripts in Linux, that is, 4 ways to run shell scripts in Linux, and the friends you need can refer to the followingThere are

linux[basic]16-shell Judging user parameters [01]

Shell to determine user parameters Conditional test statements are able to test the characteristics of an expression that is trueThe return value is 0 when the condition is setOtherwise, return other valuesTo test the statement format:[ conditional

The shell traverses multiple folders and modifies file names in batches

Problem: Change the ing_ in the picture name to 0.Current directory: $ lspic,change_name.shpic/|__kk1/|__img_001.jpg|__img_002.jpg|__vv2/|__img_005.jpg|__abc_002.jpgSolve:Write the following in change_name.sh:#!/usr/bin/env SHCD picDir= ' ls. 'For

Shell Start-Stop script

To list any process listening to the port 8080:lsof-i:8080To kill any process listening to the port 8080:Kill $ (Lsof-t-i:8080)or more violently:Kill-9 $

Parentheses in the Shell function

One, parenthesis, round brackets () 1, single parenthesis () ① command group. The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses cannot be used by the rest of the script.   Multiple commands in

Shell Scripting Exercises

The new handwriting of the shell, write bad, please forgive us.Hope to make some great gods and peers. qq:86416192 welcome everyone to add QQ.1, write a script, show how many users, and display the ID of each user.#!/bin/bashFile= "/etc/passwd"lines=

Shell Special position variable ($0,$1$2,$*,$#,$$,$?,$@,${})

$ file name and path$1,$2 parameter 1, parameter 2$#     The number of arguments passed to the script or function $$     current shell process ID $?     judge execution succeeded or not 0 for success [email protected] Pass all

Shell script Base numeric operation judgment and if statement

Numeric operationsInteger operation "Three kinds, one can be mastered"Expr numeric operator number[[email protected] ~]# Expr 1 + 1 (OP symbols are all +-*/NOTE: * Requires \*.) % is the remainder, only 0 1 2)2[[email protected] ~]# Expr 45 \*

Linux Common Command Collation (iv): package Management and Shell basics

Hello everyone, I'm a singing program, ape ~~~~~~.Recently in the study of Linux, spare time on these basic commands to organize, I hope you can use, the purpose of the finishing is to forget when the turn out to see ^?_?^, before and after a total

Shell, Xterm, gnome-terminal, Konsole Introduction

gtk

What is a shell?Simply put, the shell is a small program that can accept commands from the keyboard and send them to the operating system, and then the system executes. In the past, this was the only interactive operation available on computers that

Set command detail: On, turn off Shell feature properties

Set is a shell internal command to turn shell feature properties on or off, and if nothing is added, the user-defined variables and environment variables are displayed directlySyntax: Set [Options ...]Options:- F : Disable wildcard characters+f :

Tips for bad interpreter:no such file or directory when executing shell scripts

Symptom: In terminal direct Cd/var normal, execute in shell script is error. The reason is that the script is written under the Windows platform, and the line break is different from Linux, causing the script to not execute correctlyThe cause of bad

Shell Development Specification

Version 1.0, refer to some articles on the web to be structured. Later intends to continue to revise. Complete a shell development specification that suits you.Last modified: 2017.6.25I. Naming specification 1, version and operating parameters1)

7 Ways to use shell functions

1. Define the function and reference inside the shell file:Copy CodeThe code is as follows:[~/shell/function]# Cat factorial.sh#!/bin/bashfunction factorial{Factorial=1For ((I=1;i Dofactorial=$[$factorial * $i]DoneThe factorial of Echo $ is:

Copy command and library file to/mnt/sysroot/directory shell script

#!/bin/bash# #获取目标目录target =/mnt/sysroot# Command copy function cmndcopy () {        # If the order does not exist,return 1        if ! which $1 & > /dev/null; then                 return 1        fi          #获取命令决定路径         cmnd=$ (which --

HDFs Common shell commands

HDFS File Operations Command[ email protected] sbin]$ Hadoop fsusage:hadoop fs [generic options] [-appendtofile ... ] [-cat [-IGNORECRC] ...] [-checksum ...] [-CHGRP [-R] GROUP PATH ...] [-chmod [-R] PATH ...] [-chown [-R] [Owner][:[group]]

Write a shell script and bat script that kills Gradle daemon

1. Gradle Daemon is also the Gradle daemonGradle needs to run in a Java virtual machine, each execution of the Gradle command means that a new Java Virtual machine is started, loads Gradle classes and libraries, and finally executes the build. In

Shell script to install Zabbix agent automatically

#!/bin/bash#install the Zabbix Agent#Create by ShiyongID Zabbix &>/dev/null | | Useradd-s/sbin/nologin ZabbixMkdir/etc/zabbix/var/log/zabbixChown zabbix.zabbix/var/log/zabbix/Tar zxf

UNIX Changes Shell display color

When writing a shell script. By changing the shell's display color, you can not only change the experience of using the shell terminal, but also more useful, you can distinguish the normal output by changing the color of the display content. Output

[4] Algorithm path-insert sort shell interval and sedgewick interval

TopicThe Insert Sort method takes a value out of the back end of the unordered half. Inserts the appropriate position in the first half of the sort. The concept is simple but the speed is unpleasant.sort of to speed up one of the basic principles

Total Pages: 541 1 .... 128 129 130 131 132 .... 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.