Recent programming uses SFTP upload files, and need to use crontab preset timed upload events. Unlike FTP, SFTP does not provide options such as-I can encode the password directly into the program. Using the SFTP directive, the user is automatically
basename example.tar.a.b.c.gz. c.gz
# => example.tar.a.b file= "
example.tar.gz"
echo "${file%%.*}" Fetch Head Example
# => example
echo "${file%.*}" go tail example.tar.a.b.c
# => Example.tar
echo "${file#*.}" Go head
There is also a way to go volume, often it is more convenient than the method of the previous article.
To understand this approach, consider the area shown on the left side of Figure 1, that is, the first quadrant axis and the area shown by the
If statement 1.1 if statement explanation
If is a judgment statement, if the action is similar to [], the general judgment is more or the execution of the statement is more, then will use if
1.2 If format
First format
if [
8.10 Shell Special Character _cut command* Any of any characters? Any one character#注释符号\ de-Justification symbol| pipe character"$" the symbol with "!" "!$" means the last variable in the previous command";" Delimiter, use "~" User's home directory
$ () and ' (anti-quote)In the bash shell, $ () and "(anti-quote) are used for command substitution.$ echo the last Sunday was $ (date-d "last Sunday" +%y-%m-%d)Get the date of the previous SundayThe reason for using $ ()1. "Easy to mix with" (single
logical operators
logical operators used in [] and test
logical operators used in [[]]
Description
-A
&&
And and, both ends are true, then true
-O
||
Or OR, at both ends
To write a program that imports data in batches, learn to write shell scripts! Now learn to use!============================================1, the first simple for loop#!/bin/bashFor I in 1 2 3 4;Doecho $i;Done2. Test for self-growing
If the expression contains special characters, the Shell will replace it. For example, using a variable in double quotes is a substitution, and an escape character is also a substitution.As an example:
#!/bin/bash
A=ten
echo-
Sometimes back to SSH tunnel, the manual use of SSH to create these is not too big a problem, but if you try to boot, write a shell script and run the script in Rc.local is not successful, the reason is not known.Later discovered autossh this thing,
1. Understanding Shell Scriptshell Script is a "program" that uses the shell's function abbreviation, which uses plain text files to write some shell syntax and commands (including external commands) in it, with regular expressions, pipeline
First, Introduction1.Bash (Bourne Again Shell), currently the default shell environment for most gnu/linux systems.Commands are entered and executed in the shell terminal. After opening the terminal, the prompt form: [email protected]$ or [email
The quickest way to learn to write script is to watch someone else's script file. However, although this method is practical, it is often "less effective" or even halfway to the shell's basic cognitive deficit. The first problem is that you don't
1 shell overviewThe shell is a command interpreter that provides the user with an interface system-level program that sends a request to the Linux kernel to run the program. The user can start, suspend, stop, or even write some programs with the
Original: JavaScript's date format, which mimics the format of the date command in the shellThe current date is displayed in the shell[[email protected]]$ date '+%Y-%m-%d %H:%M:%S'2015-01-19 16:24:58It is inconvenient to format the date object in
The RC in the configuration file. bashrc in the home directory indicates resource configuration.
What is login shell? What is a non-Logon shell?
Logon shell refers to the shell that is started after the user enters the user name and password
Original post: http://topic.csdn.net/u/20071101/11/4bf1047d-dc46-4b39-9766-4f05b0eeaca7.html
Shell syntax error: unexpected end of file error message [Closed, closed by: myepoch]
Add as a friend
These are some messy things. If none of them can be separated into segments, join them together. It should be said that these messy things should be put at the end to get a chapter similar to a glove box, but since most of these messy contents are
Kafree collection
Source: The source cannot be determined for Forum reprinting. Please contact us if you have any copyright questions.
1. Stream Object
Component: "Adodb. Stream"
There are the following methods:
Cancel Method
The usage is as
Linux login & non-login shell and su, sudo related concepts, linuxlogin1. login & non-login shell
In Linux, the kernel will create the init process to perform a series of system initialization operations. When a user logs on to the shell, the
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