Now the vast majority of users are using the Windows system, all know that the Windows system has 32-bit and 64-bit, in fact, the Linux system also has 32-bit and 64-bit, you know your Linux system is a few? Here's how you can use the shell to see
Example:
1.
File_jpg= "Sample.jpg"
name=${file_jpg%.*}
echo File name is $name
File name is sample
2.
File_jpg= "Sample.jpg"
extension=${file_jpg#*.}
Echo Extension is $extension
File name is jpg
3.
File_name= "www.google.com"
Echo
There was a problem working with files today, and the for loop is problematic when the file name contains spaces.
For example, I create 3 files in the current folder that contain spaces:
Copy Code code as follows:
The shell sort is a modification to the insertion sort, it divides the elements of the sequence into several subsequence by an increment each time, inserts a sequence of these substrings, and then increments the number of elements in each
The shell problem of the user's work:
Problem Description:
You need to intercept the certificate encoding information for the following command output:
#openssls_client-showcerts-connect192.168.0.111:443|sed-ne
Automated deployment and monitoring of development scripts1. Scripting automatic deployment of reverse proxy, web, NFS;Requirements: I, the deployment of Nginx reverse proxy three Web services, scheduling algorithm using weighted polling;II, all Web
Loop of shell scripts: repeating commands1.for CycleGrammar:For variable name in variable Value listDoCommandDoneFor based on the contents of the variable Value list, executes the command repeatedly until all the contents of the Variable Value
In writing shell scripts, we need to use a variety of special symbols, through these special symbols can make the code we write more concise and efficient, here are summarized below:1. {} curly braces:Usage One: Wildcard extensionEg:ls
The next best thing to do on a virtual machine: Docker is the most convenient1. Installing RpmbuildYum-y Install Rpmbuild rpmdevtools-y2. Generate a package pathWith Rpmdev-setuptree, a Rpmbuild folder is automatically generated in the user's home
Method One: Switch to the directory where the shell script executes the shell script:cd/data/Shell. /hello.shThe./means to execute hello.sh under the current working directory. If you do not add./,bash may respond to an error message that could not
Encountered a remember a1, omit sudoUsing the Su-i command after landing with the primary user will log in as root in the shell, then the command will not need to add sudo and password. Another user has tried, Su does not have the-i option. Online
The IF function in the shell is beyond doubt that every 80% of the shells will be applied to if judgment, then as a novice I should be the whole, I heard a morning class today, and then the morning's things summed up a script, and then to the people
Linux-shell First Lesson1, through a small example to introduce the shell#! /bin/sh Call Sehllecho Print content read input cd jump directory pwd View current directory650) this.width=650; "title=" 1.jpg "src=" https://s5.51cto.com/wyfs02/M00/8D/EA/
Installation of the Linux SendEmail tool 1. Download the file #wget http://files.cnblogs.com/files/sunziying/sendEmail-v1.56.tar.gz2. Installing #yum Install SENDEMAIL3, main parameters:-F is the From, the sender address-t means to, the recipient
#!/bin/bashExport Chknum=1#shell搅拌存放目录 (The output log file is also stored in the directory after it is executed)Echo 3 >/wls/wls81/shellSyncWhile [$chknum-ge 0]Doecho "-------------------------------------------------------" >> Trace.logmt= ' Free |
How to compile Bash execution(1) Bash test.sh(2) chmod 755 test.sh #给bash赋予可执行的权限 r-4 w-2 x-1./test.shBash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays. Similar to the C
Basic assignment of an array
Arr= (a b C)
Arr[index]=a
2. Two common methods
Str=${arr[@]} (array converted to string)
len=${#arr [*]} (array length)
3. Ways to
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