[-A file] true if the file exists. [-B file] If the file exists and is a special block file, it is true. [-C file] If the file exists and is a special character file, it is true. [-D file] If the file exists and is a directory, it is true. [-e
we know that variables are inherited by quilt processes, it can be used directly. In some cases, you may need to inherit functions to facilitate transparent use. The method is very simple. Use "Export-F". Pay attention to the parameter "-F", which
Execute the SQL statement of the Oracle database in Shell
#### Function #### Description: Execute an SQL statement ### input parameters: {SQL statement} {database TNS} {database user name} {Database User Password} #### output parameters: SQL
FTP server 172.17.17.17
Account yangsh
Password 7183458
1. fixed form
#! /Bin/shEcho "this is my first FTP auto script"Echo "Open 172.17.17.17 21User yangsh 7183458PWDPut ftp.txtCloseBye "| FTP-I-in
2. parameter transfer
#! /Bin/sh
1. write scripts. You can use shell and Perl. Find 100 files starting with ABC in the/tmp directory, and save the first line of these files to file new.2. write scripts and use shell and Perl. Put all the rows in file B but not in file,Save as file
I just learned shell and encountered a problem. The total error occurred during execution: Unexpected
Operator. I used Ubuntu 9. 04. I learned from laruence to go to the shell script section,
The script is as follows:
#! /Bin/bash
# Program:
#
I recently tested LTP. I felt that there were too few materials on hand. I searched the internet and said that I had to look at the code from the beginning, because I had to look at the links in the past, there are too many test cases, so it is no
1. Glossary:
The following is Wikipedia's explanation:
Here document[1], also known as heredoc, hereis, here-string or here-script, is a shell (such as SH, CSH, KSh, Bash, powershell, and zsh) in the command line) and define a string method in the
Reprinted: http://www.360doc.com/content/10/0303/16/155970_17438894.shtml
Example 4-2. Simple variable assignment
1 #! /Bin/bash 2 # "naked" variable 3 4 Echo 5 6 # When is the variable "naked", such as when the front side is less than $? 7
Structured commands: Allow scripts to skip or execute these commands cyclically based on the conditions of variable values or the results of other commands
1. Use the if_then statement
If command
Then
Commands
Fi
Run the command after if first.
Suppose I want to run a script with parameters. After running the script, the screen displays the following data:
What is the program file name?
How many parameters are there?
If the number of parameters is smaller than 2, the user is notified
#! /Bin/bash
Tc_home =/opt/Oracle/tomcat/
InstanceName = $1 [created instance]
CD...>/dev/null
Template_dir = 'pwd'
Echo $ template_dir
If [! -D $ tc_home]; then
Mkdir-p $ tc_home [Create if the directory does not exist]
Fi
Usemethod
Document directory
Determine whether the file is a device file
Add User:
IP address access statistics:
Calculate the sum of 2 numbers
Text Analysis
File Sorting
Print the swap partition size of the Local Machine
Output the time used to
1. query all files with no Suffix in the current directory:
Find.-Type F-and! -Name "*.*"
2. query all files in the current folder that use the Windows Line Break (CRLF) and have no suffix. Use the-M parameter to convert them to Unix format (LF ).
Common System Variables$0 name of the current program$ N the nth parameter of the current program, n = 1, 2 ,... 9$ * All parameters of the current program (excluding the program itself)$ # Number of parameters of the current program (excluding the
1. system environment variables after the user logs on to the system:$ Home user's own directory$ Path: the directory to be searched during Command Execution$ TZ Time Zone$ Mailcheck the number of seconds to check whether a new letter exists$ PS1
Color is selected by adding a special sequence --Basically"/E ["And"M"Between numeric values. If more than one numeric code is specified, separate them with semicolons.Echo-e "/E [31; 40 m"
First digit (31)Foreground color(Red); The second digit is(4
A few days ago, when I needed to call the binary program in Java code, I found some information on the Internet and wrote something to record.
Android is also a Linux-based system, and can also run binary executable files. However, Android only
My platform: Ubuntu 10.04Solution 1:Lsusb, view the vendorid, and add or modify the 51-android.rules file in the/etc/udev/rules. d/directory.Add a record:Subsystem = "USB", sysfs {idvendor} = "XXXX ",Mode = "0666" where XXXX is the value obtained
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.