The essential point in programming is debugging, Shell script with its powerful function is desirable, of course, its powerful is not only embodied in the language of the implementation function, more powerful is its debugging function, below, I
What is login Shell: Login shell can be used by user login, such as/bin/bash,/bin/sh,/bin/csh ... The general Linux Default User shell is bash, which means you can log in and write commands.
Non-logon shell: The classic/bin/nologin is a non-login
These two days, because the work needs to do some of the process of work, look at some of the online examples, mostly through the way of pipeline files to achieve, and then think about it without so much trouble ...
The following is a simple
Linux CentOS Shell display-bash-4.1$ does not display the user name path solution
Problem Description:
CentOS A new user, log in after the information of the shell script is as follows:
Rather than the combination of username@hostname we
Lattice, as follows:
The code is as follows
[root@myvps1697 201407]# netstat-ntpl|grep sshd|grep-v grep |awk-f: ' {print $} '
In order to solve the problem of space, the 3 of my group have asked all the time, now I know how powerful people, a lot
In the process of database operation, the Shell script provides great convenience for operation and maintenance. A shell script parameter passed as a variable to SQL and a SQL script is one of the scenarios that DBAs often encounter. This article
Write a script:
1. Use function to realize:
To determine whether a user exists, the user name passed through the parameters;
If present, the shell and UID of this user are displayed
If it does not exist, it is said that the user does not exist;
What is a shell?
The Shell is an interface between the operating system and the user that interprets the commands the user emits, launches the application, and manages the user data with system features. The shell can run multiple processes
If you need to get the full path of a selected file, little brother often mechanically copied the path in the shell window, then copied the file name and spelled it after the path. Sometimes the file path is copied for use by the program, which
Job 3:
Requirements are as follows:
Write a script:
1, create a function, you can accept a disk device path (such as/DEV/SDB) as a parameter, before really start the next step to remind users of the risk, and let the user choose whether to
The size of the log is very large, the server is generally Linux, HP, AIX, and so on, every time the download back to the trouble of the deadly, in the open source China to see the following content, very practical.
1. Use the Find and Xargs
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
Special characters:#! Sign of the beginning; Delimiters with multiple commands together[Email protected] log]# echo A;echo b;echo CABC. Multiple functions:1. Equivalent to the source command2. As part of the file name (hide filename) (use ls-a to
Shell Basics (i)* represents 0 or more arbitrary characters? represents an arbitrary character# Comment symbol, comment description meaning, that is, the content behind the # Linux ignored, or in the shell script to explain the symbol, explain the
String interception from the original address: http://www.jb51.net/article/56563.htmOne: string interceptionThere are VAR variables:var=http://www.aaa.com/123.htm1. # Intercept, delete the left character, leave the right character.echo ${var#*//}Www.
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
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
Delete
${varname#strmatch}//Match the Strmatch from scratch in varname and then remove the position from the beginning to the first match
${varname# #strMatch}//Match the Strmatch from scratch in varname and then delete the position
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