Five, for security requirements each execution of the shell manually entered the password$ VI test5.sh#!/bin/bashEcho-n "Enter password for u_test:"Read PASSWDSqlplus-s/nolog Conn u_test/$PASSWDSELECT * from tab;ExitEof$ chmod +x
Simple implementation of the more commands under Unix:#include #define Pagelen 24#define linelen 512int do_more (file * file); int see_more (file * file); int main (i NT Argc,char * argv[]) {FILE * fp;if (argc = = 1) do_more (stdin); Else{int
During scripting, input to parameters is usually involved. For example, SH 1.sh 10 20, in the execution of 1.sh this script, 10 is the first parameter, 20 is the second parameter. Sometimes there is this confusion about how many variables can a
Files that are often edited under Windows are sent to Linux remotely, ^m at the end of each line, which causes the shell script to run incorrectly, mainly because the editor under dos and the editor under Linux are inconsistent with the carriage
Comparison and judgment are the elements of program flow control. This article summarizes shell comparison and judgment statements for ease of searching and using. 1. Important comparison Operators Greater than:-GT Less than:-lt Greater than
1 shell 的$! ,$?, $$,[email protected]
$n $1 the first parameter,$2 the second...
$# The number of command-line parameters.
$0 The name of current program.
$? Last command or function‘s return value.
$$
#! /Bin/sh # program description # scripts for implementing the tomato working method # tomato working method rules # Rule 1: A tomato lasts for 30 minutes, including 25 minutes of work and 5 minutes of rest. # Rule 2: the time of a tomato is
Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 2446
Problem descriptionin the 17th century, with Thunderous Noise, dense smoke and blazing fire, battles on the sea were just the same as those in the modern times. but at that time,
Shell script tracing and debug
Before scripts runs, the most feared problem is the syntax error! So how can we debug it? Is there a way to determine whether there is a problem without directly running the scripts? Haha! Of course! Let's take the
Recently, as the project requires remote access to the svn server, but there is no fixed domain name or IP address, we plan to use a peanut shell to apply for a free domain name to build a server, and then deploy visualsvn on the server, you can
-EQ equals
-Ne is not equal
-GT greater
-Ge is greater than or equal
-Lt is less
-Le is less than or equal
SEQ 1 30 numbers from 1 to 30
Touch-mt2010030303.03 $ dir: Modify the directory time format
STAT/tmp/1.dir view the modification time
Lines
There are a lot of for loop usage in shell. I always want to summarize it. Today I saw a summary of for loop usage on the Internet, which is very comprehensive. So I will turn to research and study...
1. For (I = 1; I 2. Commonly Used in shell is
1. The true and false values in bash are not the values 0 and 1 we generally think.
True and false are built-in shell commands that return logical values. For example:
$ True
$ Echo $?
0
$ False
$
Tag: ShellStrictly speaking,
Because 0 is the default value of
> This method is used to export data to a file. If the file does not exist, the file is created. If the file exists, the file is cleared. Generally, this method is used when we back
1. Echo Parameters
-N does not wrap (default line feed)
-E makes the transfer character valid
Example
Ss = 'abc \ n' echo-e $ ssabc # echo $ ssabc
2. When assigning values = do not include spaces on both sides
A = "hello" # error A = "hello"
3.
[[Email protected] shell] # Cat getopts. Sh
#! /Bin/bash
# Date = 2014-09-16
# Is to practice the getopts
While getopts "A: BC" Arg (: The preceding variable must follow the parameter)
Do
Case $ ARG in
A)
Echo "A's Arg: $ optarg"
;;
B)
Echo "B"
;;
C)
Basic Regular Expressions and shell Regular Expressions for Linux shell Programming
Fast query of Linux commands and Shell programming examples
Covers common Linux commands, including Shell script programming syntax, text processing
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