CN107992327A - The method that the script write under a kind of Windows environment is adapted to Linux - Google Patents
The method that the script write under a kind of Windows environment is adapted to Linux Download PDFInfo
- Publication number
- CN107992327A CN107992327A CN201711336429.8A CN201711336429A CN107992327A CN 107992327 A CN107992327 A CN 107992327A CN 201711336429 A CN201711336429 A CN 201711336429A CN 107992327 A CN107992327 A CN 107992327A
- Authority
- CN
- China
- Prior art keywords
- script
- linux
- tableinfo
- write under
- screen
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/76—Adapting program code to run in a different environment; Porting
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The present invention relates to Linux user interface techniques field, the script write under more particularly to a kind of Windows environment is adapted to the method for Linux.The method includes following steps:Step 1: create initial table tableInfo;Step 2: every a line in script is all read in into tableInfo;Step 3: carry out line number matching;Step 4: perform all orders;Step 5: add-back newline, is output to screen;Step 6: determining whether script tail, it is, exits the program.The script write under windows is adapted in linux by the present invention, can directly be used in linux platforms.
Description
Technical field
This method is related to shell Script Programming technical fields, and the script write under more particularly to a kind of Windows environment is fitted
Should be in the method for Linux.
Background technology
The lightweight non-interactive type stream editing machine of all unix platforms (including Linux) is used for choosing data, replacing
Change, delete, increase newly.So-called non-interactive type, text can only be edited in input editing order under order line by referring to, then on the screen
Check output;And editing machine is flowed, refer to only read in a line, the place for then specifying the row from file (or input) every time
Reason, and result is output to screen (unless eliminate screen output and do not use print command explicitly), under then reading in
A line.Whole file is handled and then exported line by line line by line as flowing water.
The content of the invention
Present invention solves the technical problem that it is that providing the script write under a kind of Windows environment is adapted to Linux's
Method;Lift the portability of script.
The present invention solve above-mentioned technical problem technical solution be:
The method includes following steps:
Step 1: create initial table tableInfo;
Step 2: every a line in script is all read in into tableInfo;
Step 3: carry out line number matching;
Step 4: perform all orders;
Step 5: add-back newline, is output to screen;
Step 6: determining whether script tail, it is, exits the program.
Currently processed row is stored in tableInfo tables by the method in processing, is then handled interior in table
Hold;After the completion of processing, content in table is sent to screen;Then next line is handled;So constantly repeat, it is whole until end of file
A script is disposed.
Beneficial effects of the present invention:The script write under windows, adaptive can arrive linux platforms, improve portable
Property.
Brief description of the drawings
The present invention is further described below in conjunction with the accompanying drawings:
Fig. 1 is flow chart of the method for the present invention.
Embodiment
As shown in Figure 1, this method uses following steps:
Step 1: create initial table tableInfo;Such as:
Step 2: the newline of each end of line in script is read in into tableinfo
tableinfo(char const*const fname)
Step 3: line number matching judgment.
Step 4: perform adjustment format command;
S/href=([^ ">]+)/href=" 1 "/g
S/alt=([^ ">]+)/alt=" 1 "/g
S/ (alt=" [^ "] * ") [^>] * (href=" [^ "] * ")/2 1/g
s/<a[^>] * href="/<A href="/g
Change href=" xxx " ... alt=" yyy " to href=" xxx | yyy "
s/\(<A href=" [^ "] *) " [^>] * alt=" ([^ "] and * ")/1 | 2/g
s/.*<A href=" ([^ "] *) " .* $/1/p
s/\(.*\)<A href=" ([^ "] *) " .* $/1/
t loop
Step 5: add-back newline, is output to screen;
Gis-t "=" $@| gis-t's/^ //;N;s/^*\(......\)\n/\1/'
Step 6: determining whether script tail, exit the program
Claims (2)
1. the method that the script write under a kind of Windows environment is adapted to Linux, it is characterised in that:The method includes
Following steps:
Step 1: create initial table tableInfo;
Step 2: every a line in script is all read in into tableInfo;
Step 3: carry out line number matching;
Step 4: perform all orders;
Step 5: add-back newline, is output to screen;
Step 6: determining whether script tail, it is, exits the program.
2. according to the method described in claim 1, it is characterized in that:The method stores currently processed row in processing
In tableInfo tables, the content in table is then handled;After the completion of processing, content in table is sent to screen;Then handle next
OK;So constantly repeat, until end of file, whole script is disposed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711336429.8A CN107992327A (en) | 2017-12-07 | 2017-12-07 | The method that the script write under a kind of Windows environment is adapted to Linux |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711336429.8A CN107992327A (en) | 2017-12-07 | 2017-12-07 | The method that the script write under a kind of Windows environment is adapted to Linux |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107992327A true CN107992327A (en) | 2018-05-04 |
Family
ID=62038411
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711336429.8A Withdrawn CN107992327A (en) | 2017-12-07 | 2017-12-07 | The method that the script write under a kind of Windows environment is adapted to Linux |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107992327A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1664816A (en) * | 2005-03-11 | 2005-09-07 | 谢永强 | Method for realizing transplantation between information websites of different platforms |
CN101013436A (en) * | 2007-01-25 | 2007-08-08 | 无敌科技(西安)有限公司 | Method and system for converting text data of different formats to uniform format |
CN103197947A (en) * | 2012-01-04 | 2013-07-10 | 中兴通讯股份有限公司 | Script processing method and device |
CN103226545A (en) * | 2013-04-19 | 2013-07-31 | 中国建设银行股份有限公司 | Data format conversion system, and method and system for batch loans information import |
US20140053056A1 (en) * | 2012-08-16 | 2014-02-20 | Qualcomm Incorporated | Pre-processing of scripts in web browsers |
CN105320589A (en) * | 2014-07-14 | 2016-02-10 | 上海计算机软件技术开发中心 | Automatic analysis system for testing scripts in cloud testing environments and realization method thereof |
-
2017
- 2017-12-07 CN CN201711336429.8A patent/CN107992327A/en not_active Withdrawn
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1664816A (en) * | 2005-03-11 | 2005-09-07 | 谢永强 | Method for realizing transplantation between information websites of different platforms |
CN101013436A (en) * | 2007-01-25 | 2007-08-08 | 无敌科技(西安)有限公司 | Method and system for converting text data of different formats to uniform format |
CN103197947A (en) * | 2012-01-04 | 2013-07-10 | 中兴通讯股份有限公司 | Script processing method and device |
US20140053056A1 (en) * | 2012-08-16 | 2014-02-20 | Qualcomm Incorporated | Pre-processing of scripts in web browsers |
CN103226545A (en) * | 2013-04-19 | 2013-07-31 | 中国建设银行股份有限公司 | Data format conversion system, and method and system for batch loans information import |
CN105320589A (en) * | 2014-07-14 | 2016-02-10 | 上海计算机软件技术开发中心 | Automatic analysis system for testing scripts in cloud testing environments and realization method thereof |
Non-Patent Citations (1)
Title |
---|
ANY小鱼: "windows编辑shell脚本在linux下怎么使用", 《HTTPS://WWW.CNBLOGS.COM/WLY719/P/7154241.HTML》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Warden | Big data glossary | |
HK1066304A1 (en) | Importing and exporting hierarchically structured data | |
CN108363943B (en) | Customs clearance robot based on intelligent recognition technology | |
WO2015143910A1 (en) | Method and device for defining search engine result pages by user | |
KR101687828B1 (en) | System and method for generating electronic document | |
CN107992327A (en) | The method that the script write under a kind of Windows environment is adapted to Linux | |
CN104537026A (en) | Paper archive file processing method based on local cache | |
CN107590116A (en) | A kind of method and system of compilation and design file | |
CN107943763A (en) | A kind of big text data processing method | |
Jin | A steady-state capturing method for hyperbolic systems with geometrical source terms | |
Halsey | Microsoft Visio 2010 Essentials | |
CN104182227B (en) | A kind of method and system for generating template preview graph | |
CN107368981A (en) | A kind of books checking method and system | |
CN102855233A (en) | Method and device for integrating language words | |
Darmell et al. | Connected or Disconnected: The Art of Operating in a Connected World | |
CN108681466A (en) | A kind of CPU card control method, electronic equipment and storage medium based on formatted packet instruction | |
Selimi | Language of News: Narration and Foreign Language Expressions in Online Media in the Albanian Language in Kosovo | |
Zefaj | Critical Success Factors for the implementation of Total Quality Management in Small and Medium Enterprises: Literature Review | |
Limani | Design education: challenges and opportunities resulting from technological developments | |
Kadriu | Green Tourism and its Impact in Environmental Development | |
CN106973004A (en) | A kind of information processing method, server and client side | |
Hagen | Nikon capture NX 2 after the shoot | |
Spat et al. | Promoting Monuments of Prizren Throught Technology | |
Meyer et al. | Arm Postures in Living Crinoids | |
Dibra et al. | Talent management–a strategy for millennials higher retention |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180504 |
|
WW01 | Invention patent application withdrawn after publication |