When using shell in Linux, arrays are occasionally used for convenience. The declaration method of the array is:
Array = (element1 element2 element3... elementn)
That is, wrap the array elements directly with parentheses, and separate the array
Must begin #! /Bin/sh start
Start a line of comment #
$ # Indicates the number of parameters input by the script
$1, $2,... indicates 1st parameters, 2nd parameters ,...
Shift is used to move the $ n parameter to the next parameter, which is
Shell metacharacters and shell internal variables
Shell metacharacters > Prog> file redirects the standard output to the file> Prog> file: attaches the standard output to the file.| P1 | P2 uses the P1 standard output as the P2 standard
Below is a simple Linux ShellCodeThe function is used to find the current directory and all its directories which contain the four characters "html" and print the file name, at first glance, there should be no problem with this code, but there are
Shell scripting is an interpreted language;
The essence of shell scripts is an ordered set of shell commands;
1. Basic shell programming process
1) create a shell file
2) grant executable permissions to chmod A + x filename
3) execute the shell file.
Based on the tutorials on the official website, the test is available.
Note that you must use the root permission to run the task.
#!/bin/bash# This script run the init command for opotimus pc;# Fedora 19;# run as the rootecho 'run as the root'yum
Shell sorting is a form of change in insert sorting. Because insert sorting compares each element and compares the current element with all the previous elements, in the worst case. Therefore, DL. shell proposed shell sorting in 1959, that is,
Some terminal shortcut keys:
CTRL + F
Forward one character
CTRL + B
Move one character behind
CTRL + E
Move to end of line
CTRL + L
Clear Screen
CTRL + d
Delete current
Shell scripts are used to record some exercise questions and shell scripts I have actually written here for learning and querying.
User input y or y ends
While Mode#! /Bin/bashRead-P "input you choice:" CWhile ["$ C "! = "Y"-a "$ C "! =
Shell script Learning (1): Shell variables and some common commands
Shell allows you to create variables to store data, but does not support basic data type variables (such as int, float .....), shell interprets any value assigned to a
List of Common Unix shell commands
Passwd Change User Password PWD print current directory CD change Directory ls list directory file wildcards *,? Any number of characters and a single character file print out the file type cat display
If the command "Set-X" is added to the script file, each command executed after the set command and any parameters added to the command line (including the values of variables and variables) will be displayed. A plus sign (+) is added before each
Install JDK in Linux
Download the original JDK version of Sun: http://java.sun.com/products/archive/. you can download any JDK of sun. I used to find jdk1.4.2 _ 08 for a long time and I couldn't find it. I accidentally found this portal useful, so
Summary of Linux Shell shortcut operations (including shortcut keys and efficient operations ):
CTRL +: Start with the command line
CTRL + E: End of the command line
CTRL + L: Clear screen, equivalent to the clear command
CTRL + u: Cut the content
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