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

Tag: shell

Getopts in the shell

getopts is a built-in command of the shell.

getopts optstring name [args]
OPTIND,OPTARG,OPTERR

getopts is used by the shell program to analyze positional parameters. optstring contains

October 18, 2021By Simo Unix getopts, shellLeave a Comment

Shell script prints ninety-nine multipliers

The shell script prints the nine-nine-nine multiplication table #!/bin/bash

for i in {1..9}
do
for j in {1..9}
do
if [$j -le $i]
then
echo -n “${j}X${i}= $(($i*$j)) ”
fi
done

October 18, 2021By Simo Unix ninety-nine multiplier, print, Script, shellLeave a Comment

Shell script for While Until loop

Flow controlLogic processing in programming: Sequential execution
Select execution
Circular execution Loop Loop execution
Repeat a certain code segment several times
How many times it repeats
T

October 18, 2021By Simo Unix loop, Script, shellLeave a Comment

Shell script Advanced (for, while, continue, break, select, etc.)

Advanced script oneOne, the second way of writing for loop:

As we all know, there are two ways of writing for

< strong>How to write directly:

Two parentheses must be written after

October 18, 2021By Simo Unix advanced, break, Continue, etc, First, Script, select, shellLeave a Comment

Execution method of shell scripts

When the Shell script runs, it will first look for the system environment variable ENV, which specifies the environment file (the order of loading is usually /etc/profile, ~/.bash_profile, ~/.bashr

October 18, 2021By Simo Unix detailed, execution, method, Script, shellLeave a Comment

Shell programming actual combat 7

1. Count the number of digits in the document

2. Compare the differences between the files of the two machines

#!/bin/bash

dir=/data/web

[ -f /tmp/md5.list] && >/tmp/md5.lis

October 18, 2021By Simo Unix actual combat, programming, shellLeave a Comment

Shell Programming Foundation-3

1. while loop

Syntax structure: while condition; do……; done

1) Infinite loop

While:

do

command

done

2) Endless loop

While 1

Do

command

October 18, 2021By Simo Unix foundation, programming, shellLeave a Comment

The most complete shell script statement syntax (super detailed)

Blog post outline:

Don’t talk nonsense, just use the grammar example:

Requirement①:
first name and 2. last name, and finally displayed on the screen: “Your full name is:” content:

October 18, 2021By Simo Unix all, detailed, grammar, scripting, shell, statement, super, useLeave a Comment

Shell exercise -15

Question requirements
Write a shell and see if there are custom users (ordinary users) in your Linux system. If so, how many?

Core points
centos6 uid>=500
eentos7 uid>=1000

awk -F’:”

October 18, 2021By Simo Unix exercise, shellLeave a Comment

Shell Training Day6 8.20

shell
See 100 linux shell questions.
Function to reduce duplication of code.
Shell is a collection of system commands

The first line starts with #!/bin/bash
#!/bin/bash
echo “123”
w
ls
Sp

October 18, 2021By Simo Unix 8.20, Day, day6, shell, trainingLeave a Comment

Posts navigation

Page 1 Page 2 Page 3 Page 4 … 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