For whatever purpose, the script's role is to generate a directory-tree-structured text file that supports Chinese and file directory names with spaces. Like what$./gdt.sh/cygdrive/e/ccccc-oCcccc.txt The/CYGDRIVE/E/CCCCC directory tree structure
Strictly speaking, there is no concept of an expression in the shell. The shell itself is simply a collection of commands, and certainly not a bunch of random piles, but a certain organization. But this organization is not so rigorous, so this
Sed and awk are powerful text filtering tools in the UNIX environment.
With SED and awk, it is easy to edit local files, and it is easier to use regular expressions to filter out the output of other commands.
SED represents the stream Editor,
The difference between a single middle bracket and a double bracket in a shell
1.["[" is an executable program, the path is "/usr/bin/["He is equivalent to the executable program "test".
Example:If [3-eq 2]; Thenecho "= =";Elseecho "!=";Fi
Export database query results through the Shell to Excel, and send messages to the mailbox #!/bin/bash# through the shell to query the data information and save in Excel, and record the log #data:2018-06-14#name:zhang# Database connection address
1. Interview questions: Use the For loop in the/tmp directory to create 10 HTML files in bulk, where each file needs to contain 10 random lowercase letters Plus fixed string template, such as the followingAaesdffbnv_template.htmlMethod 1:Cd/tmpfor ((
Shell languageScript: Can run, a file, can implement some function (command stacking)[Email protected] ~]# vim/root/stu.shecho Hello WorldCat/etc/redhat-releaseUname-rHostnameIfconfig | Head-2[Email protected] ~]# chmod +x/root/stu.sh[Email
Difference:1, two files are set environment variable file,/etc/profile is a permanent environment variable, is a global variable,/etc/profile.d/set all users to take effect, is also a permanent variable, is a global
Requirements: Use the shell to customize a variety of personalized alarm tools, but the need for unified management, standardized management.Idea: Specify a script package that contains the main program, subroutine, configuration file, mail engine,
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
Objective After installing CDH and Coudera Manager offline, all of your own apps are installed through Coudera Manager, including HDFs, hive, yarn, Spark, hbase, and so on, and the process is a twist, so don't complain and go straight to the
#!/bin/bash
#for嵌套for循环
#9 *9 Multiplication Formula
Echo "for 99 multiplication table"
for ((I=1; i
Do
For ((j=1;j
Do
#当 $j less than or equal to $i, the multiplication table is printed on the screen
[ $j-le $i] && echo-n "$i *
1. Functions in the shellThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call thisThe name of a small unit.Format: function F_name () {Commond}function must be placed at the
First, new peanut Shell 1.0On the Peanut Shell official website (http://www.oray.com) Download "New Peanut Shell 1.0" installation software, software installation completed, need to register, after the successful registration of Peanut Shell website
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.