Read about shell script string concatenation, The latest news, videos, and discussion topics about shell script string concatenation from alibabacloud.com
It used to be some kind of shell, Python needs some habits, here's the Python string concatenation#!/usr/bin/python# -*- coding: utf-8 -*-import timeimport shutil,osuptime = time.strftime("%Y%m%d")path = "/var/tmp/cslc/aw/backup/"uppath =
The shell is the user interface of the Linux operating system, and we often need to write scripts to allow the operating system to automate the requirements of a series of instructions, this article will briefly describe the language features
Shell script for file traversal and Deletion
The functions to be implemented in this article are as follows: a folder has a folder named by number, and files except the maximum encoding need to be deleted.Implementation
General idea: traverse all
The following features are required for this article: a folder that has a folder that is named by a numeric number requires the deletion of files other than the maximum encoding.Specific implementationGeneral idea: Loop through all the files in the
(a) file creation command 1.touch commandFor example, the Touch ABC command creates an empty file named ABC in the local directory2.CP commandThe CP command allows us to copy the contents of a file to a file of the same name or name, and copy the
Common commands and statements for Shell programming (SCRIPT) and Common commands for shellSome common Shell programming (SCRIPT) commands and statements can meet general requirements.Command Parameters received:
Number of parameters:
$ #
An article that understands Shell scripts,
Shell scripts use the Shell command interpretation function to parse a plain text file and then execute these functions. It can also be said that Shell scripts are a collection of commands.Shell can be
Shell scripts implement file traversal and deletion,
The functions to be implemented in this article are as follows: a folder has a folder named by number, and files except the maximum encoding need to be deleted.Implementation
General idea:
One: Hello WorldCreate a new file, named after the. sh suffix. Each bash file begins with the first row of table names file type: #!/bin/bashThen enter the code below.For example, the output Hello World:#! /bin/"helloworld"Run Bash file:./file name.
1.Shell stringStrings are the most common and useful data types in shell programming (except numbers and strings, and no other type works well), strings can be in single quotes or double quotes, or without quotes.1.1 Single quotation marksStr= ' I
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.