2018-04-15

南昌大学实验报告

姓名:王梦佳

学号:6103115097

邮箱地址:[email protected]

专业班级:计科153班

实验日期:2018.4.14

课程名称:LINUX程序设计

实验项目名称

Bash Programming

实验目的

To write shell scripts to solve problems
To implement some standard Linux utilities such as ls,cp,etc using system
calls

实验步骤

Use Bash for Shell scripts

  1. Write a Shell script that accepts a filename, starting and ending line numbers as
    arguments and displays all the lines between the given line numbers.
  2. Write a Shell script that deletes all lines containing a specified word in one or more
    files supplied as arguments to it.
  3. Write a Shell script that displays list of all the files in the current directory to which
    the user has read, Write and execute permissions.
  4. Write a Shell script that receives any number of file names as arguments checks if
    every argument supplied is a file or a directory and reports accordingly. Whenever the
    argument is a file, the number of lines on it is also reported.
  5. Write a Shell script that accepts a list of file names as its arguments, counts and
    reports the occurrence of each word that is present in the first argument file on other
    argument files.
  6. Write a Shell script to list all of the directory files in a directory
  7. Write a Shell script to find factorial of a given integer.

实验数据或结果

第一题 实验结果:


test1.png

第二题 实验结果:


test2-1.png

test2-2.png

删去单词linux


test2-3.png

第四题 实验结果:


test4.png

第六题 实验结果:


第七题 实验结果:


test7.png

参考资料

https://www.jianshu.com/

你可能感兴趣的:(2018-04-15)