Question: Sometimes it is convenient to debug with a scrapy shell, but sometimes using the Scrapy shell returns 403, such as the following:
c:\users\fendo>scrapy shell https://book.douban.com/subject/26805083/ 2017-04-17 15:18:53 [scrapy.utils.
This article mainly describes how to output colored content in a shell script.
In a shell script, both Echo and printf can output content. Let's look at the following example
Echo-e "\033[43;35m David use echo say hello world \033[0m \ n"
printf "\
CMD1 && cmd2 If the command cmd1 result status 0, the CMD2 is executed, otherwise the CMD2 command is not executed.
cmd1 | | CMD2 if the command cmd1 result status 1, the CMD2 is executed, otherwise the CMD2 command is not executed.
can be used for
Shell Programming I. Introduction to the ProgramProgram程序:算法+数据结构数据结构:数据在计算机中的类型和组织方式算法:处理数据的方式面向过程:以指令为中心,数据服务于指令面向对象:以数据为中心,指令服务于数据计算机:二进制执行Advanced Programming Languages:编译:高级语言->编译器->机器代码->执行解释:高级语言->执行->解释器->机器代码 shellThree major
Using echo to display colored content in a shell script requires the use of the parameter-EThe format is as follows:" \033[Word background color; text color m string \033[0m"For example:" \033[41;36m Hello World \033[0m"Where 41 of the position
Purpose: To determine whether a file (test.gz.txt) suffix is a zipCorrect command: if [[${filename} =~ ^test.*zip$]]Here are a few things to keep in mind:
use [[]] for its related usage see link 1;
=~ is connected, I am in use, did not pay
Words do not say much, directly on the format:function formats in the Linux shell:function Myfunc () {Action[Return int;]}Among them, the individual thinks function and () are all functions of the flag, if you do not need to pass parameters , choose
Shell scripts create users in bulk and randomly generate passwordsRequirements: Batch creation of 10 system account OLDBOY01-OLDBOY10, and set the generated password (password is different).Implementation script:#!/bin/bash#Question3For I in $
1,ssh UnderstandingThere are two servers, one is local, one is the cloud, all Linux systems, if we want to access the cloud system locally, then we can use SSH command, can be used to log in locally remote connection, upload or download files to the
1. Echo1.1, by default, Echo adds a line break after each call1.2, the content to be printed, you can use single quotation marks, double quotation marks or direct printing, different ways, have their own restrictions1.2.1, using the non-quoted Echo,
1. How to write the script for the Android app to start the service and execute the script?/device/tegatech/tegav2/init in the root directory of the android source code. the RC file is believed to be familiar to everyone (if you do not understand it,
ADB shell am Function
ADB shell am can use this command to start activity, services; send broadcast and so on from the CMD Console: C: \ Users \ Administrator> ADB shell AM
Usage: am [subcommand] [Options]
Start an activity: am start [-D] [-W] -D:
If you do not use the built-in command but fork to output a sub-process and execute it in the sub-process, the path of the parent environment will not be changed.
After the execution is completed, it returns to the parent shell environment, and the
Differences between return and exit in Linux Programming
Exit is used to end the execution of a program, while return is only used to return from a function.
Return
Return indicates that the function is returned from the called function to the main
In Linux/Unix, apart from calling SQL, calling PL/SQL is also a common situation for DBA. The following mainly uses some examples to show how to call PL/SQL under shell.
Other related references:Linux/Unix shell scripts call SQL and RMAN
Basic shell programming
1. Start Script Programming
#! The/bin/sh line is the shebang line, which tells the system that the following command is executed by shell.
#!/bin/shPERSON="Yuesichiu"echo $PERSONecho "what is your name?"read PERSONecho
/Etc/profile: This file sets the environment information for each user in the system. When the user logs on for the first time, this file is executed.And collect shell settings from the configuration file in the/etc/profile. d directory./Etc/bashrc:
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As LongPrivate Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As
Article from:
Http://learn.akae.cn/media/ch31s05.html
Conditional test for shell script Syntax: test or [
CommandtestOr[You can test whether a condition is true. If the test result is true, the exit status of the command is 0. If the test result is
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.