One, view memoryAndroid program memory is divided into 2 parts: native and Dalvik,dalvik are the Java heaps we normally call, the objects we create are assigned here, and bitmap are allocated directly on native, and the limit for memory is native+
[Email protected] bin]$ sh-n restart.sh[Email protected] bin]$-N: Do not execute script, just check the syntax, if there is no output correctly, if there is an error, you will be prompted[Email protected] bin]$ sh-x restart.sh+
1. Manually parse parameters, position parameters(1) $#: Number of parameters(2) $1...$9: first parameter ... 9th parameter2. Built-in command parsing, getopts, long parameter format not supportedCommand format: getopts option_string variableThe
File descriptor
STDIN: standard input, receive input from mouse, keyboard or other input device, file descriptor is 1
Stduot: Output All normal output results, file descriptor is 2
STDERR: Output All error messages, file descriptor
In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of a $n, for example, $ $ for the first argument, and $ = for the second argument ...Examples of
Today when writing a shell script to find the need to set the user's password, and the setting of the password is interactive, so in the script is obviously not very good, so the Internet to find information, found the following two non-interactive
1. Write a script that calculates the factorial of 10 using a loop #!/bin/shFactorial=1For a in ' SEQ 1 10 'Dofactorial= ' expr $factorial \* $a 'Doneecho "10! = $factorial "2. Write a script, after the execution, print a line prompt "Please input a
The array in the shell is the same as other programming languages, considering that the shell is a weak type of scripting language that can be defined and used directly in command limeFor example:$a [1]= "Monday"$echo ${a[1]}Monday$Note that here
There are three ways to invoke external scripts when running shell scripts, exec (exec script.sh), source (source script.sh), fork (./script.sh)EXEC (exec/home/script.sh):Using Exec to invoke the script is equivalent to executing a command in the
Visiting the Chinaunix forum, you can often see the Nikkei, how to quickly sort a text content, or calculate the number of occurrences of a line. Most of these problems can be solved by simple sort, uniq commands.Prepare two text firstCat File1:Boys
By default, Unix Commands obtain input from the standard input device (stdin) and output the result to the standard output device (stdout) for display. Generally, the standard input device is the keyboard, and the standard output device is the
Overview
The file system (FS) shell contains various commands for interacting with HDFS, such as local FS, hftp FS, S3 FS, and other. FS shell. Run the following command:
Bin/hdfs dfs
Path URI can be used as a parameter for all Fs shells. The URI
Date
Linux clock is divided into system clock and real time clock (RTC. The system clock is the current Linux kernel clock, and the hardware clock is the battery-powered clock on the motherboard. This hardware clock can be set in the BIOS. When
The terminal on Mac uses the Bourne-again shell command, bash for short.
Bash is a project developed and promoted by GNU and is an extension of the Bourne shell.
Bourne shell is the original shell used by UNIX, author Steven Bourne
Bash is the
First, we will not introduce what shell scripts are. This blog only records every step of learning shell scripts.
First, we will introduce the basic shell rules:
The shell script is not a complex program. It is explained by line. The first line of
Shell is an important tool in Unix/Linux to parse user input commands. Next we will implement a simple shell program to practiceFork/exec/Wait/exitBy the way, we recommend a book titled understanding Unix/Linux programming-A Guide to theory and
Awk
Awk is a programming language used to process text and data in Linux/Unix.
SedSed is a stream editor that is a very useful tool in text processing.
GrepGrep is a powerful text search tool, which is often used in combination with pipelines.
Tag: ShellIn shell command line, the average person may not care much about the differences between the two pairs of symbols () and,
Although both of them can group multiple commands, the technical details are quite different:
() Place the Command
By long Luo
Recently
Weather ForecastProject, you need to download some weather icons from Yahoo, but because there are many icons, there are more than 80. Icons are stored on the Yahoo image website.
Thunder does not support HTTPS download.
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