ZhangZhihui's Blog  

 

zzh@ZZHPC:~$ cat a.txt
The need for a stipulative definition is often occasioned by some new phenomenon
or development. For example, many years ago lions were crossbred with tigers. The
word “tigon” was selected to name the offspring of male tiger and a female lion, and
“liger” was selected to name the offspring of a male lion and a female tiger. When a
zebra was crossbred with a donkey, the offspring was called a “zeedonk.” Crossbreeding
a lime with a kumquat produced a fruit that was called a “limequat,” and crossbreed-
ing a plum with an apricot produced a fruit called a “plumcot” and a “plout.” All of
these words were first assigned their meanings through stipulative definitions.
zzh@ZZHPC:~$ sed ':a;N;$!ba;s/\n/ /g' a.txt | sed 's/- //g' The need for a stipulative definition is often occasioned by some new phenomenon or development. For example, many years ago lions were crossbred with tigers. The word “tigon” was selected to name the offspring of male tiger and a female lion, and “liger” was selected to name the offspring of a male lion and a female tiger. When a zebra was crossbred with a donkey, the offspring was called a “zeedonk.” Crossbreeding a lime with a kumquat produced a fruit that was called a “limequat,” and crossbreeding a plum with an apricot produced a fruit called a “plumcot” and a “plout.” All of these words were first assigned their meanings through stipulative definitions.

 

Explanation:

  • :a and ba: Create a loop.

  • N: Append the next line to the pattern space.

  • $!: Apply the loop to all lines except the last.

  • s/\n/ /g: Replace newlines with a space (or nothing).

posted on 2025-06-06 17:44  ZhangZhihuiAAA  阅读(6)  评论(0)    收藏  举报