During this period of time, I was engaged in big data research. Where should I find a large amount of data? Well, some automatic generation tools on the Internet do not meet my own needs, so I wrote one myself, A script that can generate a large
This article mainly summarizes some of the basic knowledge worth noting in shell programming.
1 .#! /Bin/Bash must be placed in the first line of the file
2. num = 2. When values are assigned, spaces are not allowed on both sides.
3. Echo "this
Introduction to several common Shells
Linux provides a variety of shell options. Frequently used include Bourne shell (SH), C-shelll (CSH), KoRn shell (Ksh), And Bourne again shell (BASH ).
(1) The Bourne shell is developed by Steven Bourne Of
1 -- shell Method for reading files
# Use the READ command to read a row of data while read mylinedoecho "line:" $ mylinedone
# Use the READ command to read a row of Data cat datafile.txt | while read mylinedo echo "line:" $ mylinedone
# Read
Shell scripts are similar to batch processing in Windows/DOS, that is, various commands are pre-placed into a file, and then the file can be executed to achieve similar features as batch processing, it is mainly used by administrators for setting or
Shell special characters
Wildcard
Wildcard characters are used for pattern matching, such as file name matching, path name searching, and string searching. Common wildcard characters include (*),(?) And the Character Sequence enclosed in square
1. log files are regularly cleared on the AIX machine to release the disk space occupied by log files.
Shell does not seem to have a function to process date computing. It is very convenient to process date in Java, and it is too difficult for
1. CTRL + W Delete the last word
2. CTRL + u delete a row
3. CD-Return to the last working directory
4. Cd ~ Return to the Home Directory
5 .! $
! $ Is a special environment variable, which represents the last string of the previous command.
Example:
When you use shell functions, it is easy to run another executable program in the VB program. In this article, I will show you how to improve Shell functions in a simple way.
Shell accepts two independent variables. The first is the name of the EXE
In Linux Shell, you can define functions and call them in shell scripts. The following describes the definition method and the precautions for calling it.
1. Define the shell function (define function)
Syntax:
[Function] funname [()]
{
Action;
Exercise content:
When the.txt file exists under the folder, if the.txt file exists, a new a-1.txtfile is created. If the file does not exist, the t.txt file is created;
Three conditional expressions of if
1,
If condition 1;
HP integrity ServerOn EFICommands supported by the Shell InterfaceWhen npartition is active but the operating system has not been bootedCan be accessed from the npartition ConsoleEFI shell.You can use the following command categories:• "Pilot
From: http://bbs.chinaunix.net/viewthread.php? Tid = 445229
Quote: $ unset
$ [-N "$ A"] & ["$ A"-lt 100] | echo 'too big! '
Too big!
Why can we get the above results? Mark
Question 1010) & | what is the
1. I want to know which shells have been installed on my machine?You can view the following two methods:
First:
[Rocrocket @ wupengchong ~] $ CHSH-l/Bin/sh/Bin/bash/Sbin/nologin/Bin/zsh
Second:
[Rocrocket @ wupengchong ~] $
Sometimes, the execution path of the entire shell script file is determined based on the command execution result status.
A simple requirement is to determine whether a row of content exists in a file. If yes, no operation is performed. Otherwise,
Write a script to copy the folder.
Principle: first package the folder to be copied with tar, then copy the package, and then unpack the package.Receive two parameters. If the parameter is smaller than 2, an error is returned.If the target folder is
Continued Linux Bash Learning (5): Special files, aliases, options, and parameters
This article is also the third chapter of "Learning the bash Shell" 3rd Edition, Customizing Your Environment's Reading Notes II, but we will not limit it to this.
Assume that a rails program is started:Ruby script/ServerThis is usually the case:Nohup Ruby script/Server &The error output stream is also directed to the normal output stream:Nohup Ruby script/Server & 2> 1 &
To record the PID:Nohup Ruby
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