需要帮助创建Linux脚本

Mat*_*eld 1 linux command-line replace if-statement

我有以下内容:

...
#define DIRT 4
#define PLANKS 5
#define WOOD_PLANKSs 5
#define BRICKS 6
...
Run Code Online (Sandbox Code Playgroud)

我需要删除其中一行与其前面的行相同的行(例如,删除木板,因为木制图具有相同的编号,5).

有没有一种方法可以在linux(或Windows)脚本中执行此操作,也许使用if then语句?

car*_*ett 5

在Linux中,使用uniq命令和-f参数跳过比较前两个字段:uniq -f 2 <your-file>