· 7 years ago · Sep 03, 2018, 06:52 PM
1Using sed selectively
2--
3-- Current Database: `Batch`
4--
5
6CREATE DATABASE /*!32312 IF NOT EXISTS*/ `Batch` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */;
7
8USE `Batch`;
9
10--
11-- Table structure for table `BATCH_JOB_EXECUTION`
12--
13
14DROP TABLE IF EXISTS `BATCH_JOB_EXECUTION`;
15SET @saved_cs_client = @@character_set_client;
16SET character_set_client = utf8;
17CREATE TABLE `BATCH_JOB_EXECUTION` (
18 `JOB_EXECUTION_ID` bigint(20) NOT NULL,
19 `VERSION` bigint(20) default NULL,
20
21sed 's/Batch/pd_Batch/' test.sql
22
23Batch
24cash
25country
26rules
27currency
28state
29
30sed '/CREATE DATABASE|USE/s/Batch/pd_Batch/' test.sql