Recently encountered a case, to the RAC plus bare equipment, and because the customer environment is more special can not use a number of batch editing tools, eh, want to be lazy!
Here is a summary of the use of Linux, Unix with the tools to batch generation with serial number commands, other commands can also see your actual needs.
(1), the first example is the batch build LV command
Eg: Generate sequential commands in batches (the following commands can be executed directly under the CAMMD interface):
For i in {1..5};
Todo
echo "Mklv-y ' tdata_16g_$i '-t ' raw ' rac_data2_b 128" >>/tmp/mklv.sh
Done
Output results:
[root@ora10g tmp]# for i in {1..5};
> Do
> echo "mklv-y ' tdata_16g_$i '-t ' raw ' rac_data2_b 128"
> Done
Mklv-y ' tdata_16g_1 '-t ' raw ' rac_data2_b 128
Mklv-y ' tdata_16g_2 '-t ' raw ' rac_data2_b 128
Mklv-y ' tdata_16g_3 '-t ' raw ' rac_data2_b 128
Mklv-y ' tdata_16g_4 '-t ' raw ' rac_data2_b 128
Mklv-y ' tdata_16g_5 '-t ' raw ' rac_data2_b 128
(2), use VI of the replacement command to bulk edit
Basic serial number Generation command:
For i in {1..10000000};
Todo
Echo $i
Done
1> add a string at the end of a row
Use the following command to add the string "NewString" at the beginning of each line of text, note that the space exists.
: g/^/s//newstring/g
:%s/^/newstring/g
Add the string "NewString" at the end of each line with the following command:
: g/$/s//newstring/g
:%s/$/newstring/g
Inserts the string "NewString" from line 3rd of the text to the beginning of the last line:
:%s//\r/g-----------------(substitute replace, global Globals, \ r return line feed) 1 spaces replaced with 1 carriage returns
:%s/,/\r/g-----------------(Kiki,dada,mina,jiangdingyong,jiangkun,xufuli,lichengyang) 1 commas replaced with 1 carriage returns
:%s/:/\r/g--------------(Kiki:lichengyang:mina:dada) 1 colons replaced with 1 carriage returns
:%s/kiki/sunny/g-------------------Kiki are replaced sunny
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/