当前位置: 技术问答>linux和unix
今天同学去honeywell面试 Unix面试题 分享一下 大家做做看。
来源: 互联网 发布时间:2015-09-23
本文导语: 1. Jane has two identical files, filea.txt and fileb.txt. What message will she get when she types diff filea.txt fileb.txt ? 2. Jack forgot to sort his two files before a merge. Would sort provide an error message when he typed sort...
1. Jane has two identical files, filea.txt and fileb.txt. What message will she get when she types diff filea.txt fileb.txt ?
2. Jack forgot to sort his two files before a merge. Would sort provide an error message when he typed sort -m-o sorted_file.out filea.txt fileb.txt at the command line?
3. A file named filein contains the two amounts 123. and 123.33 The command is typed sort -nro sort.out filein. In sort.out which amount is displayed first, 123. or 123.33 ?
4. Assume filea.c and fileb.c both contain the line #include stdio.h What is the output of the command grep '^include' *.c |uniq ?
5. Write the grep command to display lines from the file text2 that contain a string of characters starting with st, followed by zero or more characters and ending with ing E.G. sting,straining,string,staining
6.This assignment works with a file called survey. From left to right, the columns in the file contain the name of the country, the area (in thousands of square kilometers, the population (in millions) and the continent that the country is located in. The fields are separated by a colon (:) A cat survey follows:
Canada:3852:25:North America
USA:3615:237:North America
Brazil:3286:134:South America
England:94:56:Europe
France:211:55:Europe
Japan:144:120:Asia
Mexico:762:78:North America
China:3705:1032:Asia
India:1267:746:Asia
Write an awk program file named summary.awk that will be run from the command line :
awk -f summary.awk survey
The program file should perform the following actions:
1) In the BEGIN section, headers should be printed as follows
Country Area Pop Continent Status
----------------------------------------------------------------------------------------------
Ensure that headers are aligned with the columns
Both Field Separator and Output Field Separator should be set to colon (:)
(Hint FS=":")
2) Processing section: Compare field #4
If the field is "North America" then field #5's contents should be "Complete"
If the field is "Asia" then field #5's contents should be "In progress"
If the field is "Europe" then field #5's contents should be "Not Started"
If the field is "South America" then field #5's contents should be "N/A"
The printf statement should be:
printf "%-10s %10d %10d %+15s %+12sn",$1,$2,$3,$4,$5
3) In the END section, use the NR variable and printf to print out the string
"Number of countries survyed = ?
7. Write a Perl program that asks the user to enter two numeric values. Use the strict and warning pragmas.
Store the variables in $x and $y.
If $y is not zero, divide $x by $y and display the result.
If $y is zero display the message "Division by zero is an illegal operation" and exit the program immediately using the die function.
8. Write a Perl CGI script. The script should open a new browser window and display the messages :
For promotion of CGI scripts into cgi-bin, e-mail the Web-Admin
Direct your requests to Rocket.J.Squirrel@Bullwinkle.com
Both lines should be bold face.
Hints:
1) Use the warning pragma.
2) The @ sign in the e-mail address should be escaped ( e.g. @ ) so that Perl does not evaluate @Bullwinkle.com as an array
3) Ensure your HTML tags are well-formed (e.g. every has a corresponding )
|
这个是什么?
看起来根本不像是面试的题目……否则就是面试长期在Unix下面工作的人员的题目……
看起来根本不像是面试的题目……否则就是面试长期在Unix下面工作的人员的题目……
|
这是考unix 系统管理员的吧
|
楼主厉害,什么时候公布一下你的答案,大家都在等候!
junnyfeng到时候倒给你100分 :)
junnyfeng到时候倒给你100分 :)
|
这个
应该是作系统管理员要考的题目吧
唉好多不会
继续努力
应该是作系统管理员要考的题目吧
唉好多不会
继续努力
|
很少用到的命令
|
慢难
|
honeyWell做什么的
每天早上上班的时候都能看到他们的班车,空空的
而我们公司的班车挤得要命
每天早上上班的时候都能看到他们的班车,空空的
而我们公司的班车挤得要命
|
不懂
俺是初学者
俺是初学者
|
楼上纯粹是……抢分来着?不愧是饼……
|
这些面试题Unix和linux下答案不一样。
|
第一个题目是no message????怀疑阿怀疑……
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。