If there is a possibility of a "^m" symbol in the end of a shell script that uses Windows editing
Because MS-DOS and windows are carriage return + line wrapping, so in Linux with Vim to see the code written in Windows VC, after the end of the "^m"
* Inverted quotes ' and $ () * Let's demonstrate a comparison of the output results using the inverted quotes and $ () For this result, is because the $ () in $ () has escaped to get this result because of the two \=\ in the inverted
Today, when writing a shell script, several commands are strung up to execute, and the previous command fails, and the command is not followed. Google on the Internet, find solutions, using logic and && can.
Here's a summary of how the shell
The writing of Linux shell scripts
VI test.sh
#!/bin/bash
###################
. /etc/profile
. ~/.bash_profile
##################
Path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Cd/home/huaxia/syslog2db&&ruby app.rb
The Backstage execution command, is puts the shell command to the system backstage to execute, does not display in the terminal, does not affect the user to continue to work in the terminal, even if the terminal closes the command also to
Today continue the last Find command content, mainly find and-exec and xargs combination and use.
(9) The Find command can be combined with other commands with the help of an option-exec. -exec is one of the most powerful features of find.
For
One: Cat command
Cat (CONCATENATE) is one of the commands that the command line player must learn first, and he is usually used to read, display, and splice files, but the cat's ability is much more than that, with a line of commands to combine data
Original address: http://www.cnblogs.com/Gukw/archive/2012/01/16/2323417.html
1,/etc/gitconfig:[GUI] encoding = Utf-8 #代码库统一用urf-8 to display Chinese in the Git GUI[i18n] commitencoding = GB2312 #log编码, window under the default gb2312,
my first understanding of sed
Sed is an editor, a command-style text editor. SED can be executed as a command in a terminal, or it can be saved as a SED script text-an executable sed script file, and then execute the script file. The SED editor,
believe that the progress bar everyone is not unfamiliar, every time you download something or software will be prompted by the current download task to achieve how much, of course, can have different languages to achieve, today I use a shell script
We renamed yesterday's log 00:00:01 every day, placed it in a specific directory, and then USR1 the information number control Nginx to regenerate a new log file
Create a new shell script under directory/usr/local/nginx/logs/runlog.shNote: The file
Error description: Direct start Spark-shell,pia, error, has been so started, ah, a little wrong. When you are in a bad mood, really want to delete it, and then the next version to use. But think about if the download is also this appearance, then I
File expression
-e filename true if filename exists
-d filename If filename is a directory, true
-F filename True if filename is a regular file
-L filename True if filename is a symbolic link
-r filename If filename is readable, true
-W filename if
First Master:
Parameters:
Run the HBase shell
hbase Shell Parameters
the shell that runs up after HBase
Try to run a few orders to find out:
Create ' T_person ', ' no ', ' name '
create ' t_person ', ' no ', ' name '
0 row (s) in 2.
Rules:
a--number pair, position is right
b--The result of a, the number is correct, but the position is incorrect.
After starting, a systematic initialization of a 4-bit repeatable number, such as "1223". Assuming that the user enters "1234" for the
Checkpid: Check if PID already exists, if one exists, return 0 (by viewing the/proc directory)Daemon: Start ServiceKillproc: Kill a processPidfileofproc: Finding the PID of a processPidofproc: Ditto, use the PIDOF commandStatus: Returns the state of
-B file if it exists and is a block special file, True-C file If it exists and is a character special file, True-D file if it exists and is a directory, true-e File is true if it exists-F file is true if it exists and is a rule file-G file is true
First, position variables:
$ $ Gets the file name of the current execution script, including the script path.$n gets the nth parameter of the current execution script, 1~9, greater than 9, enclosed in {}, for example: ${10}.$# indicates the number
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.