Guest User

Untitled

a guest
Jan 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. tcpmux 1/tcp # TCP port service multiplexer
  2. tcpmux 1/udp # TCP port service multiplexer
  3. rje 5/tcp # Remote Job Entry
  4. rje 5/udp # Remote Job Entry
  5. echo 7/tcp
  6. echo 7/udp
  7. discard 9/tcp sink null
  8. discard 9/udp sink null
  9. systat 11/tcp users
  10. systat 11/udp users
  11. daytime 13/tcp
  12. daytime 13/udp
  13. qotd 17/tcp quote
  14. qotd 17/udp quote
  15. msp 18/tcp # Message send protocol (historic)
  16. msp 18/udp # Message send protocol (historic)
  17. chargen 19/tcp ttytst source
  18. chargen 19/udp ttytst source
  19.  
  20. # The latest IANA port assignments can be gotten from
  21. # http://www.iana.org/assignments/port-numbers
  22. # The Well Known Ports are those from 0 through 1023.
  23. # The Registered Ports are those from 1024 through 49151
  24. # The Dynamic and/or Private Ports are those from 49152 through 65535
  25. #
  26. # Each line describes one service, and is of the form:
  27. #
  28. # service-name port/protocol [aliases ...] [# comment]
  29.  
  30. # The latest IANA port assignments can be gotten from
  31. # http://www.iana.org/assignments/port-numbers
  32. # The Well Known Ports are those from 0 through 1023.
  33. # The Registered Ports are those from 1024 through 49151
  34. # The Dynamic and/or Private Ports are those from 49152 through 65535
  35. #
  36. # Each line describes one service, and is of the form:
  37. #
  38. # service-name port/protocol [aliases ...] [# comment]
  39. tcpmux 1/tcp # TCP port service multiplexer
  40. tcpmux 1/udp # TCP port service multiplexer
  41. rje 5/tcp # Remote Job Entry
  42. rje 5/udp # Remote Job Entry
  43. echo 7/tcp
  44. echo 7/udp
  45. discard 9/tcp sink null
  46. discard 9/udp sink null
  47. systat 11/tcp users
  48. systat 11/udp users
  49. daytime 13/tcp
  50. daytime 13/udp
  51. qotd 17/tcp quote
  52. qotd 17/udp quote
  53. msp 18/tcp # Message send protocol (historic)
  54. msp 18/udp # Message send protocol (historic)
  55. chargen 19/tcp ttytst source
  56. chargen 19/udp ttytst source
  57.  
  58. cat prefix data > data.new && mv data.new data
  59.  
  60. sed -i.bak -e '1i first prefix line' -e '1i second prefix line' data
  61.  
  62. printf '0r headerfilenxn' | ex file-with-contents
  63.  
  64. printf '%sn' '0r headerfile' x | ex file-with-contents
  65.  
  66. dd if=services bs=1 count="$(wc -c < header)" 2>/dev/null |
  67. cmp -s - header ||
  68. printf '%sn' '0r header' x |
  69. ex services
  70.  
  71. cmp -sn "$(wc -c <header)" ||
  72. printf '%sn' '0r header' x | ex services
  73.  
  74. sed -i '1i
  75. # The latest IANA port assignments can be gotten from
  76. # http://www.iana.org/assignments/port-numbers
  77. # The Well Known Ports are those from 0 through 1023.
  78. # The Registered Ports are those from 1024 through 49151
  79. # The Dynamic and/or Private Ports are those from 49152 through 65535
  80. #
  81. # Each line describes one service, and is of the form:
  82. #
  83. # service-name port/protocol [aliases ...] [# comment]' file
  84.  
  85. sed '1s/.*/n&/g' examplefile| sed '1r file2.txt' | sed '1d'
  86.  
  87. $ cat - file.txt | sponge file.txt
  88. # The latest IANA port assignments can be gotten from
  89. # http://www.iana.org/assignments/port-numbers
  90. # The Well Known Ports are those from 0 through 1023.
  91. # The Registered Ports are those from 1024 through 49151
  92. # The Dynamic and/or Private Ports are those from 49152 through 65535
  93. #
  94. # Each line describes one service, and is of the form:
  95. #
  96. # service-name port/protocol [aliases ...] [# comment]
  97.  
  98. cat header.txt file.txt | sponge file.txt
  99.  
  100. cat header file.txt >file.tmp ; mv file.tmp file.txt
Add Comment
Please, Sign In to add comment