免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: palladiosh
打印 上一主题 下一主题

[学习分享] 新手报到! [复制链接]

论坛徽章:
0
31 [报告]
发表于 2015-10-19 13:03 |只看该作者
#!/usr/bin/perl
$num = $ARGV[0]*$ARGV[0]*3.14*4.0;
print "$num\n";
3

论坛徽章:
0
32 [报告]
发表于 2015-10-19 13:05 |只看该作者
helphelphelphelphelphelphelphelp

论坛徽章:
0
33 [报告]
发表于 2015-10-19 13:18 |只看该作者
!/usr/bin/perl
$ARGV=@ARGV;
print "$ARGV\n",
"@ARGV\n";
4

论坛徽章:
0
34 [报告]
发表于 2015-10-19 13:26 |只看该作者
!/usr/bin/perl
if($ARGV[0]=~m/\d.+\d/)
{
print "true\n";
}
else
{
print "false\n";
}
6

论坛徽章:
0
35 [报告]
发表于 2015-10-19 13:33 |只看该作者
#!/usr/bin/perl
$lengh = @ARGV;
$num = $lengh*4;
print "$num\n";

论坛徽章:
1
操作系统版块每日发帖之星
日期:2015-11-05 06:20:00
36 [报告]
发表于 2015-10-22 10:31 |只看该作者

我也是新手,来凑下热闹

论坛徽章:
0
37 [报告]
发表于 2015-12-07 13:24 |只看该作者
1.List the (non-hidden) files in "/usr/local/linuxgym-data/gutenberg" ordered based on modification time, from the least recently modified ("oldest") to the most recently modified ("newest"), and store this list in a file called "oldest_to_newest" in your home directory. Include only the file names. Do not include the path prefixes.
2.The "cat" command can be used add line numbers to a file. Add line numbers to the file, foo.txt located in
/usr/local/linuxgym-data/gutenberg. Save the result to the file saucy_salamander .
Hint 1: use the man page to see the options for cat.
Hint 2: use q to quit man.
3.List all files in directory "/usr/local/linuxgym-data/gutenberg" whose name starts with a "0" or a "2" or a "w" and also contains an "s" character, store this list into a file called
"trustry_tahr". The filenames must be stored with absolute pathnames. Ensure that this is exactly the output of command "ls".

论坛徽章:
0
38 [报告]
发表于 2015-12-07 13:25 |只看该作者
4.The wc command counts the number of words lines and characters in one or more files. Use wc to find the number of words
in the files /usr/local/linuxgym-data/gutenberg/foo.txt and /usr/local/linuxgym-data/gutenberg/words.
Redirect the results of the wc command to a file named raring_ringtail.
Include the full path of the input files in the output .
raring_ringtail should contain 3 lines one for each file and one for the total. The data for foo.txt should be on the first line.

Hints: use the man page to find the words option.
5.Use the command "wc" to count the total number of lines in files matching filename pattern: "/usr/local/linuxgym-data/gutenberg/7w*". Store the exact output of the wc command when used with the "line counts" option into file "lines-count.output". Ensure that the filename within the file contains the full pathname. (Hint: type "man wc")
6.Make a list of all the files from directory /usr/local/linuxgym-data/gutenberg whose names start with character "0" and contain string "rd" anywhere, and save this list in a file called 0_rd_files.txt. Ensure that only the filenames are listed WITHOUT the pathnames as a prefix.

论坛徽章:
0
39 [报告]
发表于 2015-12-07 13:26 |只看该作者
7.Create a directory called "not-7-files" under your home directory. Copy all the files from the directory "/usr/local/linuxgym-data/gutenberg" whose names do not start with digit "7" into your "not-7-files" directory.
8.Write a bash script called ten_script.sh that takes one argument (a file name).
The script should output the number of words in the first 10 lines of the named file.
Only the number of words should be printed.
Hint: use the head command to get the first 10 lines of a file.
9.Create a file called "anne-words.txt" containing only the lines of "/usr/local/linuxgym-data/gutenberg/12frd10.txt" containing the name (WORD) 'Anne'. Note that 'Annette' and 'Annemarie' do not count. Ensure there are no extra blank lines in the file "anne-words.txt" and the lines should be in the same order as in 12frd10.txt.
10.Create a file called "diminutives.txt" containing, IN THE ORIGINAL ORDER, only the lines of

/usr/local/linuxgym-data/census/femalenames.txt

containing string 'ELLE' or string 'INE' as the last part of a word.

论坛徽章:
0
40 [报告]
发表于 2015-12-07 13:55 |只看该作者
1.   ls -tr /usr/local/linuxgym-data/gutenberg > oldest_to_newest

2.   cat -n /usr/local/linuxgym-data/gutenberg/foo.txt > saucy_salamander
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP