shell基础编程sed(编辑修改稿)内容摘要:
ough at 23:00. The local nurse Miss was in attendance. 删除第一到第三行: [sam@chenwy sam]$ sed 39。 1,3d39。 The local nurse Miss was in attendance. 删除最后一行: [sam@chenwy sam]$ sed 39。 $d39。 The honeysuckle band played all night long for only $90. It was an evening of splendid music and pany. Too bad the disco floor fell through at 23:00. 也可以使用正则表达式进行删除操作。 下面的例子删除包含文本 „ N e a v e‟的行。 [sam@chenwy sam]$ sed 39。 /Neave/d39。 The honeysuckle band played all night long for only $90. It was an evening of splendid music and pany. Too bad the disco floor fell through at 23:00. 替换文本 替换命令用替换模式替换指定模式,格式为: [ a d d r e s s [, address]] s/ patterntofind /replacementpattern/[g p w n] s选项通知 s e d这是一个替换操作,并查询 p a t t e r n t o f i n d,成功后用 r e p l a c e m e n t p a t t e r n替换它。 替换选项如下: g 缺省情况下只替换第一次出 现模式,使用 g选项替换全局所有出现模式。 p 缺省 s e d将所有被替换行写入标准输出,加 p选项将使 n选项无效。 n选项不打印输出结果。 w 文件名使用此选项将输出定向到一个文件。 如替换 n i g h t为 N I G H T,首先查询模式 n i g h t,然后用文本 N I G H T替换它。 [sam@chenwy sam]$ sed 39。 s/night/NIGHT/39。 The honeysuckle band played all NIGHT long for only $90. It was an evening of splendid music and pany. Too bad the disco floor fell through at 23:00. The local nurse Miss was in attendance. 要从 $ 9 0 中删除 $ 符号(记住这是一个特殊符号,必须用 \ 屏蔽其特殊含义),在 r e p l a c e m e n t p a t t e r n部分不写任何东西,保留空白,但仍需要用斜线括起来。 在 s e d中也可以这样删除一个字符串。 [sam@chenwy sam]$ sed 39。 s/\$//39。 The honeysuckle band played all night long for only 90. It was an evening of splendid music and pany. Too bad the disco floor fell through at 23:00. The local nurse Miss was in attendance. 要进行全局替换,即替换所有出现模式,只需在命令后加 g选项。 下面的例子将所有 T h e替换成 Wo w。 [sam@chenwy sam]$ sed 39。 s/The/Wow!/g39。 Wow! honeysuckle band played all night long for only $90. It was an evening of splendid music and pany. Too bad the disco floor fell through at 23:00. Wow! local nurse Miss was in attendance. 将替换结果写入一个文件用 w选项,下面的例子将 s p l e n d i d替换为 S P L E N D I D的替换结果写入文件 s e d . o u t: [sam@chenwy sam]$ sed 39。 s/splendid/SPLENDID/w 39。 The honeysuckle band played all night long for only $90. It was an evening of SPLENDID music and pany. Too bad the disco floor fell through at 23:00. The local nurse Miss was in attendance. 注意要将文件名括在 s e d的单引号里。 文件结果如下: [sam@chenwy sam]$ cat It was an evening of SPLENDID music and pany. 使用替换修改字 符串 如果要附加或修改一个字符串,可以使用( amp。 )命令, amp。 命令保存发现模式以便重新调用它,然后把它放在替换字符串里面。 先给出一个被替换模式,然后是一个准备附加在第一个模式后的另一个模式,并且后面带有 amp。 ,这样修改模式将放在匹配模式之前。 例如, s e d语句 s/nurse/Helloamp。 /p 的结果如下 [sam@chenwy sam]$ sed n 39。 s/nurse/hello amp。 /p39。 The local hello nurse Miss was in attendance. 原句是文本行 The local nurse Miss was in attendance。 记住模式中要使用空格,因为输出结果表明应加入空格。 还有一个例子: [sam@chenwy sam]$ sed n 39。 s/played/from Hockering amp。 /p39。 The honeysuckle band from Hockering played all night long for only $90. 原句是 The honeysuckle band played all night long for only $90。 将 sed结果写入文件命令 像使用 文件重定向发送输出到一个文件一样,在 s e d命令中也可以将结果输入文件。 格式有点像使用替换命令: [ a d d r e s s [, address]]w filename „w‟选项通知 s e d将结果写入文件。 f i l e n a m e是自解释文件名。 下面有两个例子。 [sam@chenwy sam]$ sed 39。 1,2 w filedt39。 The honeysuckle band played all night long for only $90. It was an evening of splendid music and pany. Too bad the disco floor fell through at 23:00. The local nurse Miss was in attendance. 文件 q u o t e . t x t输出到屏幕。 模式范围即 1, 2行输出到文件 f i l e d t。 [sam@chenwy sam]$ cat filedt The honeysuckle band played all night long for only $90. It was an evening of splendid music and pany. 下面例子中查询模式 N e a v e,匹配结果行写入文件 f i l e d h t。 [sam@chenwy sam]$ sed 39。 /Neave/ w dht39。 The honeysuckle band played all night long for only $90. It was an evening of splendid music and pany. Too bad the disco floor fell through at 23:00. The local nurse Miss was in attendance. [sam@chenwy sam]$ cat dht The local nurse Miss was in attendance. 从文件中读文本 处理文件时, s e d允许从另一个文件中读文本,并将其文本附加在当前文件。 此命令放在模式匹配行后,格式为: address r filename 这里 r通知 s e d将从另一个文件源中读文本。 f i l e n a m e是其文件名。 现在创建一个小文件 s e d e x . t x t,内容如下: [sam@chenwy sam]$ echo Boom boom went the music [sam@chenwy sam]$ cat Boom boom went the music 将 s e d e x . t x t内容附加到文件 q u o t e . t x t的拷贝。 在模式匹配行 / c o m p a n y /后放置附加文本。 本例为第三行。 注意所读的文件名需要用单引号括起来。 [sam@chenwy sam]$ sed 39。 /pany./r 39。 The honeysuckle band played all night long for onl。shell基础编程sed(编辑修改稿)
相关推荐
色。 (一) 批量增加学生帐号 操作步骤: 1. 在 “学生 管理 ”画面,点 “批量增加 ”按钮。 2. 输入学号范围,选择用户类别。 例如:国贸 91 班有学生 50 名,学号为 16291011629150,要给这 50 个学生每人都分配 “出口商、进口商、 工 厂 、 出口地银行、进口地银行 ”的角色,采用批量增加的分配方法如下图所示。 3. 点 “确定 ”按钮,完成这些学生的 帐
easy. Just kiss her dead, frozen lips and find out what a live wire she is. Come on. Give it up for Snow White! And last, but certainly not last, bachelorette number three is a fiery redhead from a
报文省事多了。 三、网络监视功能 网络监视功能能够时刻监视网络统计、网络上资源利用率以及网络流量的异常情况,并且能够以多种直观的方式显示。 除了我们在报文捕获中已经介绍过的 Capture Panel 之外,这部分内容还有Dashbord 、 Host Table 、 Matrix 、 Application Response Time 、 History 、Protocol
e =value Server/Accept Backlog 文件中 server元素的 AcceptBacklog 属性设定 weblogic server实例能接受的最大连接数。 AcceptBacklog 决定了在等待队列中最多可以有多少 TCP连接等待处理。 设置方法: /console/ 中mydomainServersmyserverConfigurationTuningAccept
与恢复所以需要人为的去创建一个Web应用程序并在此基础上部署一个或者几个网站集,然后对网站进行相关人员组权限,共享文档,任务等功能进行适当操作然后才可以开始下面的备份测试。 具体的操作过程前面部署和配置已经叙述过,这里省略。 添加了网站用户和用户任务两个WebPart部件上传了部分测试文件3 备份整站 的批处理文件放在任意目录下,然后执行这个批处理文件。
到落伍者、站长站、站长网等网站去学习,比如搜索引擎推广、论坛推广、交流交换、 推广等等。 不过最重要的方法还是 搜索引擎优化 (搜索引擎优化)。 如果你的网站有几千条以上的内容,然后好好进行搜索引擎优化的话,可以快速的让自己的网站每天达到几千个 IP 的流量,有了几千个流量了,就可以一个月赚 上千元广告费。 当然,内容越多,每天更新的越多,你的流量就会越来越高。 搜索引擎优化就是把网站优化的符合