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
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
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
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 $
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
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=
$ 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
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 \*
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
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 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 :
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
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)
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:
#!/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 --
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
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
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
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.