"Set Environment variables"1. Use the ENV command to display all environment variables$ env2. Use the echo command to view a single environment variable$ echo $PATH3. Set a new environment variable$ export hello= "hello!"Syntax: Export
Preface to the work today encountered a problem, if you copy the file in directory A to directory B (premise directory B does not have the file), and maintain the structure of the file in directory A. The project focuses on the following:
chmod u+x./shxx1. Simple Shell Programming SH example executionDisplay the directory and file in which you are located$cat Example#!/bin/sh#this is to show what a example looks likeecho "Our first example"Echo # thisecho "We Are"/bin/pwdEchoecho
Convert the 0024.b20b.693f address into a 00:24:b2:0b:69:3f1. Dot-delimited[Email protected] ~]# echo "0024.b20b.693f" | Sed-r ' s/\b (..) (..) \b/\1:\2/g;s/\./:/g '00:24:b2:0b:69:3f2. If the colon is separated, convert the 0024:b20b:693f to 00:24:b2
1. basename is the name left after the directory is removed .example:shell>temp=/home/temp/1.testshell>base= ' basename $temp 'Shell>echo $baseThe result is: 1.test2. dirname is to fetch directory example:shell>temp=/home/temp/1.testshell>dir= '
Reproduced:http://imysqldba.blog.51cto.com/1222376/616805There are three ways to execute a shell scriptBash script name sh script name chmod +xUse the following statement to test#a. SH (does not have extension)CD/Pwdecho "Complete"However, the
echo Display in shell script with color display, echo display with color, need to use the parameter-e format as follows: Echo-e "\033[word background color; text color m string \033[0m" Example: Echo-e "\033[41;36m something Here \033[0m "where 41
HBase is an open source implementation of Google BigTable, which leverages Hadoop HDFs as its file storage system, leverages Hadoop MapReduce to handle massive amounts of data in HBase, and leverages zookeeper as a collaborative service.1.
In shell script, there are several ways to do math, although a few of the results are similar, in writing a program is enough to use a method, but we may also need to learn other people's program Ah, in the reading of other people's programs can not
Some shell command tricks in log processingQuirks's log analysis, the future of the uncertainty of the day, the only thing that may also be a bit of a point is to manually handle a large number of logs. Sum up.The input to the log file is the text
Here is a summary of some of the recent learning Shell script knowledge pointsBlog Park-Bang Bang sauce Good * * *1. IntroductionThe shell is a text interface that lets us communicate with the system. The shell script is the one written for the
1, determine if the folder existsif[-d/home/q/www];then Echo"true";ElseEcho"false"; Fi (folder exists in the system/home/q/www)2, determine whether the file existsif[-E/ETC/PASSWD];then Echo"true";ElseEcho"false"; Fiif[-F/ETC/PASSWD];then Echo"true";
1-echo ' Date ' +%y-%m-%d%h:%m:%s "'2014-11-13 15:06:262-echo ' Date ' +%y-%m-%d%h:%m:%s "'14-11-13 15:06:51Note: "+%y-%m-%d%h:%m:%s" caseThe given format controls the output, and the sequence is interpreted as follows:Percent of a text%%a of the
Method 1:Use Linux iconv to convert the Utf-8 log to GBK encoded file, and then gbk the statistics in the environment. UTF8 () { log_file= "/lcims/crontab_shell/outfile/lan_wlan_wo/socketmain.log141114_lan1" LOG_FILE_TMP= "/
The shell is also called the command line interface, which is the interface between the user and the computer under the *nix operating system. The word shell refers to the program in the operating system that provides access to the kernel service.
The detailed user of date can refer to the followingHttp://www.cnblogs.com/xd502djj/archive/2010/12/29/1919478.htmlThe specific use of date can be viewed in another post, "Shell Date command Detail" http://blog.csdn.net/runming918/article/details/722
A Tetris that was written on the web with a Linux shell script. It's the best shell I've ever seen written. Share a bit.The original author information is in the comments of the script.#!/bin/bash # Tetris game# 10.21.2003 xhchen #APP declarationAPP_
Recently due to data migration, some user information needs to be re-confirmed, perhaps a large amount of data, but the need for the final confirmation of such as the user ID and its corresponding number of user points, which will lead to the
Shell-find error parsing, shell-find Parsing
I have written an article about how to use shell to regularly clear expired files. In fact, the simple find command is used.
After my colleague adopted the script, he encountered several errors when
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.