If the file is a. css file or a. js file, it is processed.
File=$1
if ["${file##*.}" x = "css" x]| | ["${file##*.}" x = "JS" x];then
Do something
Fi
Attention:
1> extract file suffix name: ${file##*.}
# #是贪婪操作符, matching from left to right,
Problem description
A few days ago, a friend needs real-time monitoring of a Linux system under a process, when the program is running to continue to monitor, when the program is finished to the end of a word to the end, and do follow-up.
Problem
Source:
Public StaticString CreateFile () {String cmd ="Echo\"Hhahah\"> F:\\AAA\\Azzz.txt "; File File =NewFile ("C:\\Windows\\System32 "); StringBuilder result =NewStringBuilder ();Try{//execute the specified string command in a separate process
LINUX SHELL parsing JSON format
1. Use tool JQ
https://stedolan.github.io/jq/
Download version Linux version
Jq-linux64
Ubuntu Direct sudo apt-get install JQ can be. 2. Parse JSON
[Root@cas script]# cat Test.json {"Tasks": [{"id":
I wrote a Java program with the main method entry, already packed a jar and already started running under UNIX, but I wanted to write a script file to make it easier for managers to start and shut down my Java process. Similar to Tomcat
When executing a pre-existing shell script file under a Linux system, it prompts you that the file does not exist.
The general reason for this is that your shell script is written in a system that is inconsistent with your execution script, such as
Unlike Java, PHP and other languages, the process control of SH is not NULL, such as:
public class test{public
static void Main (string[] args) {
int a = ten;
if (a > 5) {
System.out.println ("A is greater than 5");
Redirect Method
When the shell sees
#!/bin/bash
GDB
Help
Quit
Eof
Pipe mode
The combination of the Echo, Sleep command, and pipe operator (|).
#!/bin/bash
(Echo ' root '; sleep 1; Echo ' root ') | passwd
Modify the root user's
One, the read command reads the file automatically removes the space before and after the line.
A.txt: (There are spaces before and after each line)
11111
222222
3333333
A.sh:
#!/bin/bash
While Read Oneline;do
echo "$oneline"
Done
Execution
The filter condition for the scan command in the Hbase Shell Prefixfilter is to filter the Rowkey.
The difference between scan and get is that get gets the data from a row, and scan gets the data from several row, so you can set the filter
In shell scripts, the variables are global by default. So recursive calls require the local keyword to be used to display identity locals so that recursive calls to functions can be implemented. Wrote a recursive calculation of factorial script,
Impala-shell Import and Export
Parameter description:
-q Query (--query=query) executes queries from the command line without entering Impala-shell
-d default_db (--database=default_db) Specify database
-b (--delimited) to format the
HBase provides users with a very convenient way to use it, which we call "HBase Shell."The HBase shell provides most hbase commands, which can be easily created, deleted, and modified by HBase shell users, as well as adding data to tables, listing
Listen to people say that text classification when processing 100G text files, incredibly without big data, processing method is to use the shell split to split into a number of small files.
Split command
NAME split-split a file into pieces
测试操作符
Common Test Operators
English name
Description
-F file
file
files exist and are normal files True, that is, test expressions are set
-d file
Direct Ory
Most basic: Remember the previous:#!/bin/bash, and the file suffix name is generally. shVI HelloWorld. SH #!/bin/bashecho"helloworld"Then remember to add permissions to the script, because the default is read and write permissions, default to all
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.