Small Example: Modify the actual page number when reading PDF books

Source: Internet
Author: User

#! /Bin/bash


# Replace the page number in this. content with the actual page number. Here, the difference between the existing page number and U + UNIX is added, and the difference between P + windows.

File = $1 # file name

Maxnum = $2

Minnum = $3

Diff4u = $4

Diff4p = $5

For pagenum in {$ maxnum... $ minnum}; # maximum and minimum pages

Do

Let pagenum4u = $ pagenum + $ diff4u

Let pagenum4p = $ pagenum + $ diff4p

# Only 4 Windows

Sed-I "s/\ $ pagenum/\ p $ pagenum4p/g" $ File

#4 Linux & windows

Sed-I "s/\ $ pagenum/\ p $ {pagenum4p} \ U $ {pagenum4u}/g" $ File

Echo $ pagenum4u

Echo $ pagenum4p

Done


Chmod 700 $1


This article is from the "andyhdchoice" blog, please be sure to keep this source http://andyhdchoice.blog.51cto.com/1521623/1548780

Small Example: Modify the actual page number when reading PDF books

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.