Makefile shell script; sed command

Source: Internet
Author: User

1. To use the shell script in makefile, you need to add the "@" symbol, for example:

@if [-D xxx]; Then \//-d to determine the existence, in the shell, with the [] number instead of parentheses

RM-RF xxx; \

Fi

@cp-FV xxx xxxx//-f Delete the existing target file without prompting the-v CP command will tell the user what is being done

Example: CP-FV temp TEMP2

Display: ' Temp ', ' temp2 '

Find all the KO files and copy

@find sor_dir-name "*.ko"-exec sudo cp-vf ' {} ' des_dir '; '

@echo "OK."

2. Sed is the Linux under the Text Processing tool

Format: sed ' s/string to replace/new string/g ' (the string to replace can be used with regular expressions)

For example, replace the related string in the xxxx of a file

@cat xxxx | Sed "s/0000/9999/g" | Sed "s/\/\/#define 7777/#define 8888/G" > xxxx2

Makefile shell script; sed command

Related Article

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.