This article mainly introduces the Shell array and associated array details and information about the instance code. For more information, see Shell array and associated array.
1. array
1.1. array definition
An array is represented by parentheses,
This article introduces the array-related knowledge in linxu shell and provides many examples for reference, including array copying, calculation, deletion, and replacement, it is a rare article to learn shell arrays.
Array declaration:
1) array
ArrayWhat is an array?An array in a computer refers to a data type that is organized in a certain order by a number of variables of the same type.The popular point is that the array is one of the variables, in terms of the current term is a variable
ArrayWhat is an array?An array in a computer refers to a data type that is organized in a certain order by a number of variables of the same type .The popular point is that the array is one of the variables, in terms of the current term is a
ls/usr/bin/The info# path Operation dirnamebasename# "" and "and" in the shell variable "" allows references to other variables by means of "" prohibit reference to other variables, as ordinary characters ' output of the command execution to the
This article introduces the Linxu shell of the relevant knowledge of the array, and a lot of examples for reference, including the copy of the array, calculation, deletion, replacement, etc., is to learn the shell array of rare good articles.
The
The Linux shell is much more powerful in programming than in Windows batching, whether in cycles or operations.
Bash supports one-dimensional arrays (multidimensional arrays are not supported) and does not qualify the size of the array. Similar to
arrays, as a special kind of data structure, have a place in any programming language, and of course bash shells are no exception. This article makes a small summary of the shell array.Here we only discuss the case of one-dimensional arrays, about
Definition: array= (1 2 3)Echo ${array[0]}Echo ${array[1]}Echo ${array[2]}echo ${array[*]} all elementsEcho ${array[@]} The length of the arrayArray AssignmentArray= (1 2 3) There are 3 elements in this arrayArray[3]=4 4 elements in this
5.1 FunctionsFormat:Func () {command}Example 1:#!/bin/bashfunc () {echo "This is a function."} Func# Bash Test.shthis is a function.The shell function is simple, with the function name followed by a double parenthesis and the double curly brace.
Require_once ' person.php ';
Header ("Content-type:text/html;charset=utf-8");
$person 001=new person ("Wuxifu", 110);
$person 002=new person ("Wuxifu", 110);
$person 003= $person 001;
//congruent (= = =) To determine the first data type to be the
Introduction: This is a detailed page for PHP to operate MySQL database recording operation functions. It introduces PHP, related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.
Array as a data structure, in some high-level languages are directly provided and implemented, of course, my shell is also some ha.
PS: This article is written because brother B in the group sent a screenshot:
My big B elder brother is still
Three, Shell script Development Basic Specification
System functions in 1,/etc/init.d/functions action using the method:
Show XXXX, and the right side shows the green OK Word: action "xxxx"/bin/true
Display XXXX, and the right side shows the red
Awk was finally able to get started, so he tidied up the article, mostly from the Internet.First, bash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays. In the shell, the array 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.