Skip to navigation Skip to content
Simon Technology Blog
  • Architecture
  • Cloud
  • Database
  • Develop
  • Hardware
  • Industry
  • Language
  • Mobile
  • Opensource
  • OS
  • Web
Main Navigation

Tag: shell

SHELL determines whether the file directory or file exists

1, file descriptor -e Determine whether the object exists
-d Determine whether the object exists and is a directory
-f Determine whether the object exists, and it is a regular file
-L Determine

October 18, 2021By Simo Unix directory, file, is there, judgment, shellLeave a Comment

Strive_tan shell programming actual combat 2-distribution system

1. Expect applications

1) Transfer files

2) Execute commands remotely, no interaction, no need to enter a password

3) The core of the online shell script (tool) is expect, which i

October 18, 2021By Simo Unix Battle, Distribution, programming, shell, Strive, system, TanLeave a Comment

Shell Training Day8 8.22

while loop

? Syntax while condition; do…; done
? Case 1
#!/bin/bash
while :
do
load=w|head -1|awk -F’load average: ”{print $2}’|cut -d. -f1
if [$load -gt 10 ]
then
top|mail -s “load is high:

October 18, 2021By Simo Unix 8.22, Day, Day8, shell, trainingLeave a Comment

Shell script prints parallelogram, diamond

Shell script printing parallelograms #!/bin/ bash

for ((i=1;i<= 9;i++)) do for ((j=9;j>=i;j- -))
do
echo -n ” ”
done

for ((j=2;j<= i;j++)) do echo -n "*" done for ((j=1;j<

October 18, 2021By Simo Unix diamond, parallelogram, print, Script, shellLeave a Comment

Shell for loop demo

test.sh

#!/bin/bash
for skill in Ada Coffe Action Java; do
echo “I am good at ${skill}Script”
done Output

bogon:Desktop macname$ ./test.sh
I am good at AdaScript
I am good at Cof

October 18, 2021By Simo Unix cycle, demonstration, shellLeave a Comment

Shell Programming: Use scripts to achieve NGINX’s guardianship restart

nginx_daemon.sh #!/bin/bash
#

this_pid=$$

while true
do
ps -ef | grep nginx | ​​grep -v grep | grep -v $ this_pid &> /dev/null

if [$? -eq 0 ];then
echo ” nginx is ok”
sleep 3
else

October 18, 2021By Simo Unix automatic, guardianship, Implementation, nginx, programming, Restart, Script, shell, utilizationLeave a Comment

SHELL script programming common sense

common sense of Shell script programming (These are often used frequently, but all kinds of materials on the Internet are vague things, personally think they are more useful)

s b sock

October 18, 2021By Simo Unix common sense, programming, Script, shellLeave a Comment

Shell script is program monitoring

Monitor the program of this machine and send alarm emails abnormally

#!/bin/bash

# Native IP
HOST=‘59.110.69.217’

# Mail service address
URL=‘http://101.201.150.205:9527’

# Mail receiving

October 18, 2021By Simo Unix Do, monitoring, program, Script, shellLeave a Comment

Shell single quotes and double quotes

#!/bin/bash
a=23
echo ‘$a’
echo “$a”

your_name=’runoob’
str=”Hello, I know you are \”$your_name\ “! \n”
echo -e $str
echo $str Output

bogon:Desktop macname$ ./test.sh
$a
23
Hello

October 18, 2021By Simo Unix and, Double, quotation mark, quotes, shell, singleLeave a Comment

Shell script for, while, case statement details and case

################for loop statement structure#############
When using for loop statement, you need Specify a variable and a list of possible values, and repeat the same command sequence for each dif

October 18, 2021By Simo Unix Case, detailed, Script, shell, statementLeave a Comment

Posts navigation

Page 1 Page 2 … Page 7
Recent Posts
  • Sencha-Touch-2 – Sencha Touch 2, Nested XML Analysis NodeValue
  • Add a separation line and format XML content
  • Is there a norm of simplified XML subsets?
  • Look at it when you write React
  • ReactJS – Present React Redux React-Router App to add the server to the Firebase hosted by the Firebase
Categories
  • Android
  • Apache
  • Apache Kafka
  • Asp
  • Auto-Test
  • Automated Build
  • Aws
  • Bitcoin
  • Browser
  • C & C++
  • C#
  • Centos
  • Cgi
  • Character
  • Cloud Service
  • Cocos2dx
  • Cordova
  • CSS
  • Data Structure
  • Delphi
  • Design Pattern
  • Dojo
  • Dubbo
  • ELK
  • Flex
  • football
  • Game
  • Hadoop
  • Hibernate
  • HTML
  • Hybrid
  • Intel
  • IOS
  • Ipad
  • iPhone
  • Java
  • Javascript
  • Jetty
  • JQuery
  • Jsp
  • Linux
  • Load Balance
  • Lua
  • Macbook
  • Macos
  • Mathematics
  • Micro Services
  • Monitoring
  • Motherboard
  • Mysql
  • Network Hardware
  • Network Marketing
  • Nginx
  • NodeJs
  • Nosql
  • Oracle
  • Os Theory
  • Performance
  • PHP
  • Postgresql
  • Power Designer
  • React
  • Redis
  • Regexp
  • Rom
  • Rss
  • Ruby
  • Search Engines
  • Shell Script
  • Silicon Valley
  • Silverlight
  • Software Design
  • Spring
  • Sql
  • Sqlite
  • Sqlserver
  • Storage
  • Storm
  • Surface
  • SVN
  • Swift
  • System Architecture
  • Tablet
  • Uncategorized
  • Unix
  • Visual Basic
  • Visual Studio
  • Web Crawler
  • WebService
  • Windows
  • Wireless
  • XML
  • ZooKeeper
Archives
  • October 2021
  • September 2021
  • August 2021
  • May 2021
  • April 2021
  • September 2020
  • September 2019
  • August 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
© Simon Technology Blog 2025 • ThemeCountry Powered by WordPress