Introduction to Linux awk and shell variable delivery __linux

First, awk uses ordinary variables in the shell Method 1: Use the quotation mark method Aa= "Hello" awk ' BEGIN {print ' $aa '} ' Output $AA awk ' BEGIN {print ' $aa '} ' Output Hello awk ' BEGIN {print ' ' $aa '} ' Output empty Aa= "hello!

The shell extracts the file suffix name and determines whether it is a specific string

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,

The shell script implements the monitoring of whether a process is running or not

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

How to invoke a shell script file in Java

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 __linux

cas

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":

LUnix How do I start and close a Java program with a shell?

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

Linux execution Shell script hint file cannot find problem resolution __linux

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

Getting started with Shell programming Three: Process Control __ Programming

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");

Ways to get the shell script to execute automatically

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

Simple backup logs and auto-restart Tomcat shell scripts

#!/bin/sh #backup tomcat1 log lastdate= ' date-d "-7 Day" +%y-%m-%d "logfile=/tomcatlog/localhost_access_log.$ Lastdate.txt if [-F "$logfile"]; Then echo ' exist file ' mv $logfile/tomcatlog/localhost_access_log. $lastdate. Txt.bak Tar

Shell-related note points

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

Filter conditions for the Scan command in the Hbase shell Prefixfilter

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

Recursion in a shell script

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 data

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 Shell Details

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

Several methods of self-increment (plus 1) of shell integer variables

#!/bin/shA=1 a=$ (($a + 1)) a=$[$a +1] A= ' expr $a + 1 ' Let a++ Let A+=1 ((a++)) Echo $a 1. Classical methodsLength= ' expr length + 1 '2. Bash only$ ((length++)) 1. i= ' expr $i + 1 ';2. Let i+=1;3. ((i++));4. i=$[$i +1];5. i=$ (($i + 1))

Split of shell command

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

Test operation symbols in shell scripts and && | |

测试操作符 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

Shell script Recursive compression practice

#!/bin/bashsrc_path=/data/www/logsdst_path=/data/www/logs_bakfor rfile in ' Find $SRC _path/-depth-maxdepth 1-type F | Awk-f '/' {print $NF} ' DOTAR-ZCPVF $Dst _path/$rfile. tar.gz $Src _path/$rfiledonefor dir in ' Find $SRC _path/*-type D|awk -F '/

Shell BASIC Programming

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

Total Pages: 541 1 .... 340 341 342 343 344 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.