我有一个文件numbers.txt,每行都包含一个数字。
我想使用该文件打印出文件中的行lines.txt,即与中的数字对应的行numbers.txt。
这可以通过awkUnix 命令行或其他方式直接在 Unix 命令行中完成吗?
例子:
numbers.txt:
1
2
4
6
lines.txt:
1: line one
2: line two
3: line three
...
6: line six
输出:
1: line one
2: line two
4: line four
6: line six