




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、西安邮电大学(计算机学院)课内实验报告实验名称:vi编辑器专业名称:计算机科学与技术班 级:计科1405学生姓名:高宏伟学号(8 位)j04141152指导教师:刘霞林实验日期:2017年05月05日type;helpforinfornaticn:qto iexittype* help01rforon - linehelptype:help verstonit 上forverstoninfohururftlnq in vil copait ibl emodetypeiset nocpforvim defaultsihe lp cp- def aulttorinto onthishodlfled
2、 by pkg - v"ln-natntalners曜lists* alioth.debtan .orgil± open sombre? and rrwly distributabehelp poor childrentn uganda1、 实验目的学习使用vi编辑器建立、编辑、显示以及加工处理文本文件。2、 实验内容1 .进入和退出vi。2 .利用文本插入方式建立一个文件。3 .在新建的文本文件上移动光标。4 .对文本文件执行删除、复原、修改、替换操作。3、 实验步骤1. 进入vi在系统提示符($)下输入命令vi和想要编辑(建立)的文件名(如example),便可进入vi
3、。2. 退出vi在命令方式下可有几种方法退出vi编辑器::wq把编辑缓冲区的内容写到你编辑的文件中,退出编辑器回到linuxshell下。:zz仅当作过修改时才将缓冲区内容写到文件上。:x与:zz相同。:q!强行退出vi。感叹号(!)告诉vi ,无条件退出,丢弃缓冲区内容。这样,先前对该文件所做的修改或输入都被抛弃。3. 运行gcc file.c -o myfile编译该文件,发现错误,理解错误。4. 重新进入vi ,对该文件进行修改,然后存盘,退出 vi ,重新编译该文件,如果编译通过,用./my巾le 执行程序。5. 运行 man date>file10 , 然后 vi file10
4、 。使用x, dd删除文本使用u命令恢复使用c, r, s等修改文本使用检索命令进行给定模式的检索。4、 实验截图1 .进入vivi-m ' vi im provedby bran moolenaar et al«2 .建立一个文件,输入 c语言程序,并含有错误file edit view stdrch termiridl help ? lfkclude«st<lto * h*7 lines, 69 char dtlei sint natno ( printf(hello wo_ldln'); return 1;3 .运行gcc编译,查看报错信息9。皆
5、selabubjntui-s vl selabubuntu:-s vt selabubuntu:-s vt file.c seldb电ubuntwt is desktopdownloadsftte,c pictures templatesloe jr-ents exanples, desktop musicpublicvideosseldbqubuntws vl flie,c"labubuntugz file.t *t* nyflieftlw.u: in function lain':rtlv.c:5:b: error: 'hvll。' undec.idred
6、 (firil u&e ln thii* pr tntf (hello viorld! >afilec:5:b: note: each undeclared identifier is reported xcn it appeert tnfile*c:5:14: error: expected,)'before 1 world1 printf(hello worulvn");function)only cnce for edth furvct5启 labgubuntu:s: 14: ?rror; strity in progriefs:72: warning:
7、hissing terntnating ' character enabled by default printf (hello world! n'r );5:14: error: htsstng ttrnlnaflng charactfr " prtntf(hello world!n,);rtleic:7:1: error: expected before ()* token ) aselabubuntu:-$ |4 .重新修改正确程序5 .修改后再次执行程序,可以看到执行结果sclabbuntu; 逅.切 15:57 0seldb/ubunvt 5elmbubun
8、rut vi file.c selab电ubuntw-s is deiktcpoohnloadsfile,cpicturestenplatesdocuren ta妃k 曰 mplvs* desktophu5 t 匚publicvideos.selabubuntu:$ vi ftle.c mlibubuntu:-$ gcc file.e *o nyflle flit.c: in function 'min': file-c:5:a: errori * hello+ undeclared (first ost in this function)prtntf(hello worldn
9、*);晦ftle-c:5:8: note: each undeclared idcnttfter ts rfportcd1 only once for cah furxt ton it appears tn file.c:11 : error; expected boforc world prlntf(hello worldin");artle.c:5:14; error: strjy 'v tn pcogrdnrue,c:s:22: wd-ntng: nlsstng tecntntlng ' character enabled by default prlntf(h
10、allo worldlnr);af5;14; error; nissing ternxnating * character printf(hello world!n-);afile.c:7:1: error: expected *;r before *' taken .eldb电ubuntwt vl flle.c kelabubjntu!-$ gec file -o nyflle selabubuntiii-s */nyftle.hello world!/ 1 seldbubuntu:-$ |6 .把日期帮助写入file10,通过cat命令进行查看sc lab ubuntu; sela
11、bgubjntui-s nan selabgubuntut-s cat date(l)date>ftleio ftleieuser gonnandsdate(l)nahedaltsynopsis ddte date* printi?r the systen jdte dnd tineoption*.r *format-u | - 'utc| >-untwrsal nhddhhnhf ccyy .s&descriptiondisplay the current tine in the gwen format, or &et the system d«
12、te.waridfltory argument, to lonq options 和re mandatory for short options toq*d. -display fine dpscribrd by 弓thing, not ' naw-'ftle=tlatefil flike -date once for each line of dtefile-ittimespec, - -iso-86b1=time5pecoutput daie/ttne tft isg 86ai format. t1mespec=1 date' for dare only che d
13、efault) h 'hour。,minutes* r * seconds *, or b ns' for date and tine t。 the indicated prellslon.,* -x efe"ence=file7.删除某些文本行$elqbubuntu; datetl)nameecripinem力菖周,user cu i undsdate*stftimgdtsply tine described by string, not 'new'f. -nie-datefile like date ortce for edch line or d
14、atefile谑 1t. *埠 15.s9 o oate(l)' itimie spec ( - ts0-8601«timespecoutput date/ttne in 150 bshl format, time5pec-1 date' for dat«only fthc default)( 'hours',1t 'seconds 11 or 'ns 1 fordte nd tine to the indicated preui写ion*-referenceifiledisplay the last modification
15、 time of file-r, -rfc-2322output date and ttmr in f?fc z32z format* example: fionf qt aug 2006 12:3 : -etjo3-rfc-3339=timespec8.使用u命令恢复删除掉的文本sclabubuntu: dte(1 )nameecripintlate(l)user coinandsmdndvtory jrgunent tc long upliont dre ndriddlor for lihort options too.-d, -datestrincdisplay tire describ
16、ed by string± not 'nowf, -file-datfftle like -ge for p»uh line of dateflle-jtimespec, -'iso-afiftl=timfspfcoutput datf/tint in iso 白68format * tihespfc=1 date' far dte only (the defaul t) j ' hours ' t, ' seconds ' t ar ' ns ' fordate and tim to the indicated precision.一 ref
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 二年级(部编语文)二年级下册阅读理解试题经典及解析
- 【语文】湖南省长沙市宁乡县金海实验小学小学四年级下册期末试题
- 2022年人教版中学初一下册生物期末解答实验探究大题试题(附答案)完整
- 2025年安全生产隐患排查治理安全培训试题含答案
- 天棚吊顶工程专项施工方案
- 2025年材料员考试题库及答案江苏
- 2025年医院病案首页填写规范测试题附答案
- 2025预防艾滋病梅毒和乙肝母婴传播技术培训考试练习题及答案
- 婚纱影楼管理咨询方案
- 管理咨询企业管理方案
- (正式版)JBT 14449-2024 起重机械焊接工艺评定
- 胚胎移植术后的健康教育
- 《怎样当好班主任》课件
- 大学美育(第二版) 课件 第六单元:乐舞的交融:舞蹈艺术
- 德化县高内坑生活垃圾填埋场陈腐垃圾开挖处置项目环评报告书
- 高考语文图文转换练习题答案+专项练习含答案
- PBT老托福语法全解析【TOEFL语法大全】
- 初中历史-《美国内战》教学课件设计
- 评论碎片化阅读(编辑综合)
- GB/T 24983-2010船用环保阻燃地毯
- GB/T 18029.14-2012轮椅车第14部分:电动轮椅车和电动代步车动力和控制系统要求和测试方法
评论
0/150
提交评论