Make a new file named sed which has only lines 1,2,3,4,5 and 6 from the original input file




Дата канвертавання26.04.2016
Памер3.41 Kb.
Create a sed script file for each task listed below. Use the -f option on the sed command and I/O UNIX redirection to create a new file based on the set.input.file available in the ~jplane directory.

  1. Make a new file named 1.sed which has only lines 1,2,3,4,5 and 6 from the original input file.

  2. Make a new file named 2.sed which has only lines 2, 4, and 6 from the original input file.

  3. Make a new file named 3.sed which has only the lines that contain the word "new" from the original input file.

  4. Make a new file named 4.sed which has only the lines that contain a lowercase alphabetic character (a-z) from the original input file.

  5. Make a new file named 5.sed which contains all of the lines from the original input file, but anytime the word "new" appears it should be exchanged with the word "old". Also make sure that if "New" appears it is replaced by "Old".

  6. Make a new file named 6.sed which contains all of the lines that do not contain a lowercase alphabetic character.

  7. Make a new file named 7.sed which replaces any line with a lowercase "d" with a line of three X's "XXX"

  8. Make a new file named 8.sed which adds a new line (three X's) before each line that contains a "d".

  9. Make a new file named 9.num.sed which contains all lines that have a numeric character in the same script that puts all lines that do not have a numeric character into the file named 9.nonum.sed.

  10. Make a new file named 10.sed which takes any "d" character and writes it out twice in a row (twice for each one time it appears in the input file).


База данных защищена авторским правом ©shkola.of.by 2016
звярнуцца да адміністрацыі

    Галоўная старонка