If parameter in shell script

[-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

Function inheritance in Shell

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

Run SQL in Linux Shell

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

Linux Shell automatically handles FTP operations

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

Shell script learning-1

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

[Linux] I just learned shell and encountered a problem. The total error occurred during execution: Unexpected Operator

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: #  

Cross-compilation in LTP testing, such as the screen shell command

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

Here document in Shell

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

"$ ()" In Linux Shell bash variable assignment

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

Usage of details in shell test-n

  #! /Bin/bash # Add the hostnameRead-P "Please input your hostname:" hostname Old = 'cat/etc/sysconfig/Network | grep hostname | awk-F = '{print $2 }''Sed-I "s/$ old/$ Hostname/g"/etc/sysconfig/Network Echo "the/etc/sysconfig/network has changed,

Basic knowledge of shell scripts 2-Use structured commands

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.

Default variable of shell script ($0, $1 ...)

  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

A script for Tomcat to create an instance (shell script)

  #! /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

Shell script FAQ

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

Notes on Linux Shell

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 and condition judgment in Shell

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

Shell script learning Summary

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

Set Font color in Shell

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

Call a binary executable program (native executable) in Android-execute shell commands in code

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

Android ADB shell cannot be started: insufficient permissions for device Solution

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

Total Pages: 541 1 .... 507 508 509 510 511 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.